I have declared two numeric variables but am unable to compare them
remote_file_size=$(curl -sI $URL | grep -i content-length | awk '{print $2}')
local_file_size=$(ls -l $file_location | awk '{print $5}')
if [ "$local_file_size" -eq "$remote_file_size" ]; then
echo "Database up to date. Update not required"
else
echo "Database needs to be updated! Downloading newer version"
wget --continue -O $file_location $URL
fi
I've also tried,
if [[ "$local_file_size"="$remote_file_size" ]];
if [[ "$local_file_size"=="$remote_file_size" ]];
if [[ $local_file_size==$remote_file_size ]];
if [[ $local_file_size == $remote_file_size ]];