Bourn Shell -n Flag Questions

N. Ersen SISECI siseci at
Fri Apr 28 23:42:03 UTC 2006


Bourne shell is bash. So you should try
bash -n scriptname


On 4/28/06, Martin McCormick <martin at> wrote:
>         I read about the noexecute flag or -n flag which is supposed
> to check the syntax of a Bourn Shell script to see what it would do if
> run, but not actually do anything.  This sounds like a wonderful
> thing, especially when one is going to run a dangerous script and you
> only get one chance to get it right.
>         I tried sh -n scriptname and it always silently succeeds even
> if I type sh -x -n somescript.  I even deliberately created a script
> with a syntax error in it and tried sh -x -n again.  It still did
> nothing but exit.  Does this just not work or am I misunderstanding
> the purpose of the flag?
>         Thanks for your help.
> Martin McCormick WB5AGZ  Stillwater, OK
> Systems Engineer
> OSU Information Technology Department Network Operations Group
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list