Article View: gnu.bash.bug
Article #912Re: I want # to be my interactive comment character; histchars bitch
From: Robert Elz
Date: Sun, 23 Aug 1992 15:29
Date: Sun, 23 Aug 1992 15:29
44 lines
2413 bytes
2413 bytes
In <1992Aug19We160535a.danj1@ihspa.att.com> danj1@ihspa.ATt.COM (Dan Jacobson) writes: | [Bash 1.12] I want # to be my interactive comment character, so | I will get this: I suspect this isn't possible - I believe bash only does commenting when its not interactive. You're right that the doc isn't consistent, and thus isn't correct. | still another definition! We're talking "anti family values", dear | friends :-) And again, no word on how to assign the third character with | out tripping off the first two... Indeed, when one looks at | bash-1.12/subst.c, one sees code reminiscent of features.texi's | version of the story. I'm not sure that the third char in histchars is really related to what you want - but if your problem is that you want to set it without setting anything in histchars[0] and histchars[1], then what is probably the best way is to set those first two to some character that has a higher priority meaning (ie: one interpreted and removed before history) so that its unlikely (though not completely impossible) that you'll ever enter one - certainly the meaning of ! would be disabled. eg: histchars='^m^m#' (which is typed as "histchars='^V^M^V^M#'" assuming you use vi style editing - probably some other way if you inflict emacs upon yourself). ^M (ie: carriage-return) is not normally going to still be there in an input line by the time history expansions are looked at. | Plus, saying "a word beginning with #" implies that | rm -rf bla # / | will get different treatment than | rm -rf bla #/ I have no idea what you're getting at here, a # alone is just a single character word that starts with # - remember that "word" here is used in the technical case of the shell, which is any sequence of characters not including any shell delimiters, or any of those delimiters - so abc is a word, as is 123, or @@@ or #abc or # kre
Technical Details
Message-ID:
<9223701.4671@mulga.cs.mu.OZ.AU>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.mu.oz.AU!kreReferences:
<1992Aug19We160535a.danj1@ihspa.att.com>Show Full Headers
Complete Article Headers
Newsgroups: gnu.bash.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.mu.oz.AU!kre From: kre@cs.mu.oz.AU (Robert Elz) Subject: Re: I want # to be my interactive comment character; histchars bitch Message-ID: <9223701.4671@mulga.cs.mu.OZ.AU> Sender: gnulists@ai.mit.edu Organization: Computer Science, University of Melbourne, Australia References: <1992Aug19We160535a.danj1@ihspa.att.com> Distribution: gnu Date: Sun, 23 Aug 1992 15:29:33 GMT Approved: bug-bash@prep.ai.mit.edu Lines: 45