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


Groups > gnu.bash.bug > #15608

Re: Issues with history substitution and its documentation

From Jim Monte <jim.monte01@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: Issues with history substitution and its documentation
Date 2019-11-18 13:10 -0500
Message-ID <mailman.1875.1574100655.13325.bug-bash@gnu.org> (permalink)
References <CA+VKLw-WX8zUz06MZ9ThuMhUuW97aJ5ted8oSfJSvrVJBLW3hA@mail.gmail.com> <CA+VKLw_XMx1xjiFt-Tio8S+Mdt_AeS9v64SuMYYMdDdDnJFSBQ@mail.gmail.com> <CA+VKLw_hceb_xzu7kzTJAVuegWzqxJDa8xw4ja5TOBPpOWvRDQ@mail.gmail.com> <643b95db-ca1f-98ff-e8c5-c79581d909d4@case.edu> <CA+VKLw-VxEe+GxvQXbTOB09HHsoqXp+6vy1z27PXeH2FgQge_w@mail.gmail.com>

Show all headers | View raw


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 '/').
If the line ends after the first delimiter, it is equivalent to :s///,
i.e., the previous old pattern is used and new is an empty string.
If the line ends after :s, no action is performed.
[root@localhost ~]# echo a b c
a b c
[root@localhost ~]# echo !:s/a
echo echo  b c
echo b c
[root@localhost ~]# echo a b c
a b c
[root@localhost ~]# echo !:s/
echo echo  b c
echo b c
[root@localhost ~]# echo a b c
a b c
[root@localhost ~]# echo !:s
echo echo a b c
echo a b c

Jim

On Mon, Nov 18, 2019 at 11:14 AM Chet Ramey <chet.ramey@case.edu> wrote:

> On 11/3/19 9:18 AM, Jim Monte wrote:
> > Two more documentation issues I have found are below.
> >
> > It appears that an empty substring event designator uses the string of
> the
> > previous substring event designator if none is provided and does not find
> > the event if there is no previous string.
>
> Thanks for the report. I'll add text documenting the behavior. (FWIW, csh
> doesn't document it, either.)
>
>
> > An empty "old" string in a substitute word modifier uses the previous
> "old"
> > if none is given, but uses an empty string if new is empty. If there was
> no
> > previous "old" string, an error is reported.
>
> As I said in a previous message, this is documented in the man page but
> omitted in the texinfo manual.
>
>
> --
> ``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/
>

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Issues with history substitution and its documentation Jim Monte <jim.monte01@gmail.com> - 2019-11-18 13:10 -0500

csiph-web