"Russ Whitaker" russwhit@mind.net writes:
hi frank
i'm not a bash expert either: it took me 2 hours to come up with the following
enter the following 6 lines of code in a file called test
#!/bin/sh if [ $1 = $2 ]; then echo "ok" else echo "oops" fi
next, chmod 777 test then try it: ./test 1 1 and ./test 1 2
now go back and change the = to == and try it and you get
./test: [: ==: binary operator expected oops
I tried this with bash 2.02 and there is no problem since = and == are interpreted the same in this case.
Are you sure you are executing the script with `bash' and not `sh' ? The first line would seem to suggest `sh' which may be the cause of the problem.
Nick.