home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: djm@eng.umd.edu (David J. MacKenzie)
-
- > Could someone familiar with 1003.2a (the UPE - User Portability Extension)
- > answer the following question for me?
-
- > What does
-
- > echo a # b c
-
- > produce if typed at an interactive shell? There is one sh-style shell out
- > in the wide world that will echo 'a # b c' instead of just 'a' and I'd like
- > to know if this behavior is POSIX-compiliant.
-
- The only explicit mention of `#' for the shell in p1003.2a is in the
- description of the Vi editing mode. It's a command to comment-out the
- current line (excerpted below). Read strictly, it doesn't appear to
- say anything about what happens when the user types a `#' as part of a
- command, only what happens when the shell inserts a `#' in response to
- a special command. Read more loosely, it requires that `#' at the
- beginning of a line begin a comment, but doesn't explicitly say
- anything about `#' in the middle of a line. Read more loosely still,
- it specifies that `#' introduces a comment in interactive shells.
-
- Perhaps I missed an implicit or blanket reference somewhere to how
- non-interactive comments affect interactive shells, which would affect
- the above analysis. If not, POSIX.2a doesn't precisely say whether or
- not that shell's behavior is compilant, so I suppose that it is.
-
-
- 4.56.7.5 Vi Line Editing Command Mode
- . . .
- The following commands shall be recognized in command mode:
- . . .
- # Insert the character # at the beginning of the current
- command line and treat the current command line as a
- comment. This line shall be entered into the command 8
- history; see 5.12. 8
-
- --
- David J. MacKenzie <djm@eng.umd.edu> <djm@ai.mit.edu>
-
-
- Volume-Number: Volume 27, Number 47
-
-