LWN.net Logo

Recent behavior changes driving me nuts

Recent behavior changes driving me nuts

Posted Jul 4, 2006 8:50 UTC (Tue) by abovett (subscriber, #13139)
In reply to: Recent behavior changes driving me nuts by jzbiciak
Parent article: CLI Magic: Using command history in the bash shell (Linux.com)

If the histverify option (set with shopt) is set, you don't need to use the # trick. Any command you type using history expansion (with !) will be recalled to the prompt for checking and editing before it is executed - hit Return to execute it. In other words, if my history looks like:

540 cat SQ9285.txt
541 ls Documents/
542 history

and I type:

rm !540:1

and hit Return, then I get:

rm SQ9285.txt

with the cursor positioned at the end of the line.


(Log in to post comments)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds