home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / gnu / bash / bug / 567 < prev    next >
Encoding:
Text File  |  1992-08-23  |  2.3 KB  |  59 lines

  1. Newsgroups: gnu.bash.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!cs.mu.oz.AU!kre
  3. From: kre@cs.mu.oz.AU (Robert Elz)
  4. Subject: Re: I want # to be my interactive comment character; histchars bitch
  5. Message-ID: <9223701.4671@mulga.cs.mu.OZ.AU>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <1992Aug19We160535a.danj1@ihspa.att.com>
  9. Distribution: gnu
  10. Date: Sun, 23 Aug 1992 15:29:33 GMT
  11. Approved: bug-bash@prep.ai.mit.edu
  12. Lines: 45
  13.  
  14. In <1992Aug19We160535a.danj1@ihspa.att.com> danj1@ihspa.ATt.COM (Dan Jacobson) writes:
  15.  
  16. | [Bash 1.12] I want # to be my interactive comment character, so
  17. | I will get this:
  18.  
  19. I suspect this isn't possible - I believe bash only does commenting when
  20. its not interactive.
  21.  
  22. You're right that the doc isn't consistent, and thus isn't correct.
  23.  
  24. | still another definition! We're talking "anti family values", dear
  25. | friends :-)  And again, no word on how to assign the third character with
  26. | out tripping off the first two...  Indeed, when one looks at
  27. | bash-1.12/subst.c, one sees code reminiscent of features.texi's
  28. | version of the story.
  29.  
  30. I'm not sure that the third char in histchars is really related to
  31. what you want - but if your problem is that you want to set it without
  32. setting anything in histchars[0] and histchars[1], then what is probably
  33. the best way is to set those first two to some character that has a higher
  34. priority meaning (ie: one interpreted and removed before history) so
  35. that its unlikely (though not completely impossible) that you'll ever
  36. enter one - certainly the meaning of ! would be disabled.
  37.  
  38. eg: histchars='^m^m#'
  39.  
  40. (which is typed as "histchars='^V^M^V^M#'" assuming you use vi
  41. style editing - probably some other way if you inflict emacs upon
  42. yourself).   ^M (ie: carriage-return) is not normally going to still be
  43. there in an input line by the time history expansions are looked at.
  44.  
  45. | Plus, saying "a word beginning with #" implies that
  46. | rm -rf bla # /
  47. | will get different treatment than
  48. | rm -rf bla #/
  49.  
  50. I have no idea what you're getting at here, a # alone is just
  51. a single character word that starts with # - remember that "word"
  52. here is used in the technical case of the shell, which is any
  53. sequence of characters not including any shell delimiters, or
  54. any of those delimiters - so abc is a word, as is 123, or @@@
  55. or #abc or #
  56.  
  57. kre
  58.  
  59.