Re: Issues with history substitution and its documentation
From:
Chet Ramey
Subject:
Re: Issues with history substitution and its documentation
Date:
Mon, 18 Nov 2019 10:51:42 -0500
User-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.2.2
On 10/10/19 10:35 PM, Jim Monte wrote:
There is an inconsistency with the documentation and behavior of the ^ word
designator. According to documentation, it refers to the first argument but
does not require a ':' before it if it starts the word designator. However,
it does not act like the numerical word designator 1 at the end of a range.
Thanks for the report. This is a bug.
[root@localhost ~]# echo a b c
a b c
[root@localhost ~]# echo !!:1-1
echo a
a
[root@localhost ~]# echo a b c
a b c
[root@localhost ~]# echo !!:^-^
echo a b^
a b^
Also it is not explicitly documented that :- is equivalent to :0-
Thanks, I'll add a note to the documentation.
--
``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/