简体   繁体   中英

How to create an alias (shortened version) for a long list of CL commands?

So I've got a long list of commands that I need to run over and over (using Linux terminal)... Example:

./path/foo --input_file <something interesting>
           --output_file <should equal input + random suffix> 
           --other_flags <need freedom here>
./path/bar --input_file <should be same input file>
           --input_file2 <should be same as output file>
           --output_file <should be original input name with some prefix>

So how do you compose a string like this in bash maybe and run it?

You could add some executable shell script in a directory mentioned by your PATH variable .

You could also define some shell functions for your interactive shells, typically in your ~/.bashrc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM