Everytime I run my script the following if statement gives me the error;
script.sh: [Error==Error]: not found
or
script.sh: [Error==-2]: not found
if ["$P1"=="$P2"];then
echo $name
fi
I've tried other versions
if ["$P1"=="$P2"]
then
echo $name
fi
and
if [[ "$P1" == "$P2" ]]
then
echo $name
fi
P1="Error"
P2="$(sed -n '1p' somefile.txt)"
somefile.txt
might contain a number or a string