Bash: Use previous expression parameters

I was running a bash command similar to this:

perl /var/www/scott/perl/test/scott.pl --size 10 --file /tmp/output.txt

and afterwards I wanted to make a small change to that script. Rather than typing out the full path you can use some Bash history expansion and do this instead:

vim !:1

If you use !: followed by a number, Bash will replace that with the Xth (starting at zero) parameter from the previous command.



Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 3.91.249.156
To prevent spam please submit by clicking the kitten: