Russ Whitaker wrote:
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
With my bash, it always reacts correctly, regardless whether I call it as `bash' or `sh'.
note: bash is from slakware 3.5
Which version is this (try `bash --version')? Not that it's really important for GPC, but I always like to find out the reasons for problems. Frank -- Frank Heckenbach, frank@fjf.gnu.de, http://fjf.gnu.de/ GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html
participants (1)
-
Frank Heckenbach