bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

History modifier :p ignored prior to another history reference


From: Dean Stanton
Subject: History modifier :p ignored prior to another history reference
Date: Tue, 3 May 2016 16:15:37 +0000

Configuration Information [Automatically generated, do not change]:

Machine: x86_64

OS: linux-gnu

Compiler: gcc

Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include 

-I./lib  -D_GNU_SOURCE -DRECYCLES_PIDS  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic

uname output: Linux dstanton-vm.tintri.com 2.6.32.26-175.fc12.x86_64 #1 SMP Wed Dec 1 21:39:34 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux

Machine Type: x86_64-redhat-linux-gnu


Bash Version: 4.0

Patch Level: 38

Release Status: release


Description:

History modifier :p is not honored when it appears prior to another history reference on the same command line.


        I tried to find a website with known bash bugs (to search to see if this issue was already discussed), but didn't find such a site.


Repeat-By:

$ echo one two three four
        one two three four
        $ echo !:2:p ; echo !$          # :p was ignored!
        echo two ; echo four
        two
        four

$ echo one two three four
        one two three four
        $ echo !:p !!       # :p was ignored!
echo one two three four echo one two three four

one two three four echo one two three four



        I expected the entire command line to be only printed and not executed. The manpage says
       p      Print the new command but do not execute it.
        Instead, the :p was ignored and the entire command line was (printed and then) executed.

        $ echo one two three four
        one two three four
        $ echo !:2 ; echo !$:p          # :p was heeded.
        echo two ; echo four
$ echo one two three four
$ echo !:1:p !$ # :p was ignored
echo one four

one four




reply via email to

[Prev in Thread] Current Thread [Next in Thread]