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


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

Re: Issues with history substitution and its documentation

Started byJim Monte <jim.monte01@gmail.com>
First post2019-11-18 12:40 -0500
Last post2019-11-18 12:40 -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 Jim Monte <jim.monte01@gmail.com> - 2019-11-18 12:40 -0500

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

FromJim Monte <jim.monte01@gmail.com>
Date2019-11-18 12:40 -0500
SubjectRe: Issues with history substitution and its documentation
Message-ID<mailman.1871.1574098837.13325.bug-bash@gnu.org>
Thank you for looking into all of these reports. My issue here was that in
both cases there had not yet been any ?string? search, so they should
behave the same way -- an event is not required to not have a most recent
?string? search. So if the default is to use an empty string as the
previous string when there is none, for consistency from the perspective of
the user, both instances of echo "!%" should output echo "" as the second
one does.
[root@localhost ~]# bash
[root@localhost ~]# echo "!%"
bash: !: event not found
[root@localhost ~]# echo a >/dev/nul
[root@localhost ~]# echo "!%"
echo ""

Jim

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

> On 11/5/19 11:44 AM, Jim Monte wrote:
> > The availability of the % string only after a command unrelated to it
> (not
> > using !??) is executed as shown below is not documented, but it probably
> > falls under the category of a bug. That is, it seems reasonable that both
> > echo "!%" commands should behave as the second one does.
> > [root@localhost ~]# bash
> > [root@localhost ~]# echo "!%"
> > bash: !: event not found
>
> If there is no history list, and hence no history entries, there are no
> events to find. Hence the error message.
>
> --
> ``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