Smylers at stripey.com
Wed Feb 23 17:48:48 GMT 2011
David Cantrell writes:
> $ svn add lib/Hlagh/Blagh.pm
> $ svn commit
> $ vi !($^*%*$
> What line-noise should I type to get the last argument to the command
> two steps back in my history? Obviously I only care about bash.
Press Alt+. twice (on Linux; might be a different modified on Macs).
Or type !-2$
> And in the general case, what gives me the Nth argument from the
> command M steps back in my history?
For the final argument it's generally quicker to keep pressing Alt+.
than to count the commands.
For the rest, typing !-M:N should do it. As shortcuts you can type ^
instead of :1 and $ instead of :N for the final argument.
I very much recommend putting this in ~/.inputrc:
That way pressing Space after using a ! expansion will expand it before
you press Enter, so you can verify it's done the right thing.
Hope that helps.
More information about the london.pm