home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.27 / text0047.txt < prev    next >
Encoding:
Text File  |  1992-05-20  |  1.8 KB  |  45 lines

  1. Submitted-by: djm@eng.umd.edu (David J. MacKenzie)
  2.  
  3. > Could someone familiar with 1003.2a (the UPE - User Portability Extension)
  4. > answer the following question for me?
  5.  
  6. > What does
  7.  
  8. >     echo a # b c
  9.  
  10. > produce if typed at an interactive shell?  There is one sh-style shell out
  11. > in the wide world that will echo 'a # b c' instead of just 'a' and I'd like
  12. > to know if this behavior is POSIX-compiliant.
  13.  
  14. The only explicit mention of `#' for the shell in p1003.2a is in the
  15. description of the Vi editing mode.  It's a command to comment-out the
  16. current line (excerpted below).  Read strictly, it doesn't appear to
  17. say anything about what happens when the user types a `#' as part of a
  18. command, only what happens when the shell inserts a `#' in response to
  19. a special command.  Read more loosely, it requires that `#' at the
  20. beginning of a line begin a comment, but doesn't explicitly say
  21. anything about `#' in the middle of a line.  Read more loosely still,
  22. it specifies that `#' introduces a comment in interactive shells.
  23.  
  24. Perhaps I missed an implicit or blanket reference somewhere to how
  25. non-interactive comments affect interactive shells, which would affect
  26. the above analysis.  If not, POSIX.2a doesn't precisely say whether or
  27. not that shell's behavior is compilant, so I suppose that it is.
  28.  
  29.  
  30.  4.56.7.5  Vi Line Editing Command Mode
  31.  . . .
  32.  The following commands shall be recognized in command mode:
  33.  . . .
  34.     #            Insert the character # at the beginning of the current
  35.                  command line and treat the current command line as a
  36.                  comment.  This line shall be entered into the command      8
  37.                  history; see 5.12.                                         8
  38.  
  39. --
  40. David J. MacKenzie <djm@eng.umd.edu> <djm@ai.mit.edu>
  41.  
  42.  
  43. Volume-Number: Volume 27, Number 47
  44.  
  45.