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.

3
  • 1
    @Gilles; Note that do is no reserved word in bourne like shells; it's perfectly valid to write, e.g., for do in do doo dooo ; do print echo $do ; done. You just can't have it at places where a command is expected. Commented Apr 12, 2015 at 7:43
  • @Janis “Reserved word” is what most shell manuals, including ksh and POSIX and (most relevantly for this answer) zsh use. The Bourne manual doesn't give a name. They are indeed only reserved at the beginning of a command (and a few other contexts), but they are called “reserved words” nonetheless. Commented Apr 12, 2015 at 11:27
  • @Gilles; the ksh documentation, e.g., felt the need to explicitly clarify that they are "reserved" only in "specific contexts", because the term "reserved word" is generally not defined that way but it has an absolute meaning about whether it may or may not be used by users. I think in the broad context of Stack Exchange questions that should be made clear. I propose to not use the term "Reserved Word" unconditionally, but only if it's truely reserved (as usually programming languages use the term), or to explicitly note the restriction (as the ksh docs do). Commented Apr 12, 2015 at 16:42