I am trying to execute the following shell script
#!/bin/sh
echo "start"
if [ $# != 2 || $1 != "first" || $1 != "second" ]
then
echo "Error"
fi
echo "done"
and I'm getting the following output: start ./autobuild.sh: line 3: [: missing `]' ./autobuild.sh: line 3: !=: command not found ./autobuild.sh: line 3: !=: command not found done
I have no idea how to resolve the errors. Even if I use -ne
instead of !=
, I get the same errors. Please help.