Ronny Standtke <ronny.stand...@fhnw.ch> wrote: > The "-n" option not seem to work. Example with a little stupid nonsense > script: > ----------- > ro...@ronny-desktop:/tmp$ cat test.sh > #!/bin/sh > if [ $blah == "test"]
This sort of error can't be caught by -n, because it's part of a specific command, not the shell grammar. Checking for ] is done when the [ command is executed. Since -n disables execution of all commands, [ won't have a chance to check for a matching ]. > Another strange thing: The man page of bash does only implicitly mention > the "-n" option in the description of the "-D" option: "This implies the > -n option; no commands will be executed." It's documented under the "set" builtin. paul