[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ESC . on # items
From: |
Chet Ramey |
Subject: |
Re: ESC . on # items |
Date: |
Mon, 17 Dec 2007 22:38:28 -0500 |
User-agent: |
Thunderbird 2.0.0.9 (Macintosh/20071031) |
jidanni@jidanni.org wrote:
> $ echo abc
> abc
> $ #echo xyz
> $
> Now do "ESC ." and experience the pain of the buzzer or visual bell
> that means one has done something bad. Yes, I know you are against
> thinking that one would ever want the last item of something one
> commented out, but at least you don't have to chastise them :-( I
> personally would give them xyz. What ever you do please don't give them
> the bell. Odd that one can ^R them but not ESC . them.
As documented, the history library is used to split the previous
history entry into words, and ESC-. fetches the last word, as if the
!$ expansion had been used.
Since `#' is the history comment character, there's no last word for
the history expansion code to fetch. The bell signals the expected
lack of output.
Not that odd the ^R, which moves between history entries, behaves one
way, and ESC-. and ESC-#, which history expand the previous entry,
behave another.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Live Strong. No day but today.
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/