bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Option "-n" not working reliably and poorly documented


From: Paul Jarc
Subject: Re: Option "-n" not working reliably and poorly documented
Date: Wed, 11 Feb 2009 15:04:41 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Ronny Standtke <address@hidden> wrote:
> The "-n" option not seem to work. Example with a little stupid nonsense
> script:
> -----------
> address@hidden:/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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]