Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15613 > unrolled thread

Re: Issues with history substitution and its documentation

Started byChet Ramey <chet.ramey@case.edu>
First post2019-11-19 10:11 -0500
Last post2019-11-19 10:11 -0500
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Issues with history substitution and its documentation Chet Ramey <chet.ramey@case.edu> - 2019-11-19 10:11 -0500

#15613 — Re: Issues with history substitution and its documentation

FromChet Ramey <chet.ramey@case.edu>
Date2019-11-19 10:11 -0500
SubjectRe: Issues with history substitution and its documentation
Message-ID<mailman.1969.1574176305.13325.bug-bash@gnu.org>
On 11/18/19 1:10 PM, Jim Monte wrote:
> Thanks again for looking at these reports. I have thankfully essentially 
> completed my implementation of history for ngspice (an open-source 
> successor to SPICE 3F5 with a csh-like front end that handles parsing a bit 
> differently than a shell would), so I believe this report will be the final 
> one.
> 
> Jim
> 
> Related to the other report, there is some more missing documentation 
> regarding the :s word modifier.
> 
> If the line ends after "old", it is equivalent to :s/old/new/ (assuming old 
> and new do not contain '/').

Well, if `new' is null, the instances of `old' are deleted. That's
consistent with other history expansions. You can already omit the
trailing delimiter if that ends the line.


> [root@localhost ~]# echo !:s
> echo echo a b c
> echo a b c

Technically, that's a bad substitution (csh throws an error), since it's
missing the delimiter. The readline code just lets it go; that's one of
the few places it's less strict than csh.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web