Monday, December 05 2005: Fun with BASH?
Maybe some fine flog reader could tell me why I keep getting an error message on Line 2 about: "/usr/local/bin/marvin: line 2: [: missing `]'" with this BASH script (btw, the script seems to execute the correct branch of code based on the passed in parameter, I' just get that annoying erro message):
$ cat marvin if [ $1 == "" | $1 == "ftp" ]; then sftp -o Port=2048 luser@localhost else ssh -o Port=2048 luser@localhost fi
From prior BASH-dabblings I've learned that spaces between tokens is of utmost importance, but I seem to be spacing all the tokens in the two logical conditions correctly...