I have a file called "s1" and it contains the following:
#!/bin/bash
var1=5
var2=4
if (( var1 > var2 ))
then
echo "$var1 more than $var2"
fi
On executing the file I get the following:
s1: 4: var1: not found
In most cases, such an error occurs due to incorrect declaration of variables, for example:
var1 = 5
but I'm declaring the variable without any extra spaces.
While executing this script, I noticed that I have created two files with the names 4
and var2
respectively
Why am I getting such an error?