![]() |
Bash command line backreference
Using lists on the bash command line, is there a way to reference a parameter appearing earlier in the command list?
For example, I have two common use cases: Code:
mkdir XXX && cd XXXOr I could do Code:
mydir=XXX mkdir $mydir && cd $mydirThe second use case is similar: Code:
chmod +x XXX && mv XXX binIdeally, I would like to type something like Code:
chmod +x XXX && mv <alt-2> binIs there such a feature in readline? Thanks, Nick |
Hello Nick,
If I understand what you're asking, I think you can get it with "!:2". Check http://www.gnu.org/software/bash/man...rd-Designators Regards, Esteban |
| All times are GMT -5. The time now is 07:24 PM. |