Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Any idea why bash -n gave the script a pass? Shouldn't it have identified the syntax error? Commented Jul 2, 2012 at 15:15
  • I've never seen the -n option for Bash. It's not in the GNU manual or the BSD manual. Commented Jul 2, 2012 at 15:18
  • Check this answer: stackoverflow.com/a/4874883/721073 Commented Jul 2, 2012 at 15:21
  • 2
    The only thing I can think is that [ is not so much part of shell syntax, it's actually a program invocation (even though it's usually a program built in to the shell). I would imagine the -n doesn't give any guarantees about correct command invocation. Commented Jul 2, 2012 at 15:23
  • 1
    Ah, that -n is part of set; the shell will pass appropriate commandline switches through set. Commented Jul 2, 2012 at 15:27