In the process of writing a shell script, I ran into an issue with the following if/else statement that falls somewhere in the middle of the script:
if [ $act -eq "add" ]
then
read - "add or update: " $comm
git commit -m "$comm $file"
else
git commit -m "$act $file"
fi
The returning error being:
./gitup: line 13: [: add: integer expression expected
and then proceeds with the rest of the script. How can I have the if segment evaluate/compare the variable to a string input rather than an integer; a different error was required when using "!=" among a couple of other things I tried.