home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / gnu / bash / bug / 561 < prev    next >
Encoding:
Text File  |  1992-08-19  |  4.8 KB  |  117 lines

  1. Newsgroups: gnu.bash.bug
  2. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ihspa.ATt.COM!danj1
  3. From: danj1@ihspa.ATt.COM (Dan Jacobson)
  4. Subject: I want # to be my interactive comment character; histchars bitch
  5. Message-ID: <1992Aug19We160535a.danj1@ihspa.att.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Wed, 19 Aug 1992 20:05:00 GMT
  10. Approved: bug-bash@prep.ai.mit.edu
  11. Lines: 104
  12.  
  13. [Bash 1.12] I want # to be my interactive comment character, so
  14. I will get this:
  15.  
  16. bash$ echo bla # pla
  17. bla
  18.  
  19. at the same time, I don't want to "enjoy" any "!" expansion (so, yes, I do
  20. set +o histexpand
  21. and, yes, it does work.  No complaint about this).
  22.  
  23. Now, about getting # to be my interactive comment character,
  24. First, we see under
  25. bash$ help
  26. |Type `help name' to find out more about the function `name'.
  27. |Use `info bash' to find out more about the shell in general.
  28. [by the way, you should add a note saying that "info" might not be
  29. installed at every site.]
  30. [...]
  31. bash$ help Variables
  32. |    histchars       Characters controlling history expansion and quick
  33. |               substitution.  The first character is the history
  34. |               substitution character, usually `!'.  The second is
  35. |               the `quick substition' character, usually `^'.
  36. no mention of comment characters here.  Plus the final "substition" is
  37. misspelled...[one of the Markowitz keywords that when misspelled may
  38. indicate stress during childhood :-)]
  39.  
  40. $ man bash
  41. |     histchars
  42. |          The two characters which control history expansion  and
  43. |          tokenization.   The  first  character  is  the  history
  44. |          expansion character, that is, the character which  sig-
  45. |          nals  the  start  of a history expansion, normally `!'.
  46. |          The second character is the character  which  signifies
  47. |          that the remainder of the line is a comment, when found
  48. |          as the first character of a word.
  49. ah ha... a different meaning for the second character!  shame shame.
  50. But no word on how to assign that second character without also
  51. assigning a first character, and thus bringing on "! expansion
  52. pleasure" :-( , [perhaps set +o histexpand would then be the official
  53. recommended way of re-nullifying that hopefully...] but, ah, dear
  54. friends, the plot thickens:
  55.  
  56. bash$ cat bash-1.12/documentation/features.texi
  57. |@vindex histchars
  58. |@item histchars
  59. |Up to three characters which control history expansion, quick
  60. |substitution, and tokenization.  The first character is the
  61. |@dfn{history-expansion-char}, that is, the character which signifies the
  62. |start of a history expansion, normally `!'.  The second character is the
  63. |character which signifies `quick substitution' when seen as the first
  64. |character on a line, normally `^'.  The optional third character is the
  65. |character which signifies the remainder of the line is a comment, when
  66. |found as the first character of a word, usually `#'.
  67. still another definition! We're talking "anti family values", dear
  68. friends :-)  And again, no word on how to assign the third character with
  69. out tripping off the first two...  Indeed, when one looks at
  70. bash-1.12/subst.c, one sees code reminiscent of features.texi's
  71. version of the story.
  72.  
  73.  
  74. Plus, I tried using various combos of the above, and could not turn on
  75. my interactive comment character, though the evil "!" expansion stuff
  76. did come back to life...
  77.  
  78. There are tons of times when I want to
  79. bash$ do some command #with the back half commented out
  80. bash$ #or even the whole thing commented out
  81. in an interactive shell.  Therefore my needs are justified and I would
  82. like to see how one does it in bash 1.12.  Hmmm?
  83.  
  84. A further bitch about the man page:
  85. |COMMENTS
  86. |     In a non-interactive shell, a word beginning with  #  causes
  87. |     that  word  and  all remaining characters on that line to be
  88. |     ignored.
  89. in the _same spot in the manual_, you should tell folks how to turn # on
  90. for interactive shells.
  91.  
  92. Plus, saying "a word beginning with #" implies that
  93. rm -rf bla # /
  94. will get different treatment than
  95. rm -rf bla #/
  96.  
  97. Too bad if other leading brand shells have the same "word" mistake in
  98. their man pages.
  99.  
  100. If you fix the "COMMENTS" part of the man page, you would also want to
  101. fix this part of the man page:
  102.  
  103. $ man bash
  104. |     histchars
  105. |          The two characters which control history expansion  and
  106. |          tokenization.   The  first  character  is  the  history
  107. |          expansion character, that is, the character which  sig-
  108. |          nals  the  start  of a history expansion, normally `!'.
  109. |          The second character is the character  which  signifies
  110. |          that the remainder of the line is a comment, when found
  111. |          as the first character of a word.
  112.                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  113. -- 
  114. danj1@ihspa.att.com (Dan Jacobson) Naperville IL USA
  115. +17089796364 Chinese~{;}5$Da~}Ji1Dan1ni2
  116.  
  117.