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*

3
  • 14
    Your observed behaviour in zsh depends on the settings and is influenced by the SH_WORD_SPLIT option. Commented Mar 21, 2013 at 15:06
  • 6
    See also Security implications of forgetting to quote a variable in bash/POSIX shells Commented Dec 3, 2014 at 22:07
  • 6
    As an aside -- all-caps variable names are used by variables with meaning to the operating system and shell; the POSIX specification explicitly advises using lower-case names for application defined variables. (While the specification quoted is specifically focusing on environment variables, environment variables and shell variables share a namespace: Attempting to create a shell variable with a name already used by an environment variable overwrites the latter). See pubs.opengroup.org/onlinepubs/009695399/basedefs/…, fourth paragraph. Commented Jul 4, 2016 at 3:24