mercredi 2 avril 2014

Bash command argument repetition with tab completion


Vote count:

0




I make frequent use of command argument repetition (is there a canonical term for this?) using the form !n:m, where n is the number of the historical command and m is the number of the argument, or short forms thereof.


Is there a way to expand such arguments in situ, so that I can then tab-complete them?


A trivial example:



$ mycmd long/path/with/plenty/of/subdirectories
$ cp !$/tediously-verbose-filename.txt .


I'd love to be able to use argument repetition without having to then type the filename out in full (or resort to dummy runs with ls or echo).



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire