[clug] Bashism desired

Scott Ferguson scott.ferguson.clug at gmail.com
Mon Mar 11 19:47:42 MDT 2013


I often wish there was way to reduce repetition within a single command
run in Bash to save typing and reduce errors.
Perhaps there is and it's so obvious I've forgotten/keep overlooking it :/

Examples:-
1. cp some_directory_path/some_file some_directory/some_file.variation
2. mv some_directory_path/some_file some_directory/some_otherfile

Desired solution:-
1. cp some_directory_path/some_file $trick/some_file.variation
or
1. cp some_directory_path/some_file $trick/.variation

2. mv some_directory_path/some_file $trick/some_otherfile


Anyone know a Bash shortcut for this?
aliases are OK (if no other way)

TIA

Kind regards



More information about the linux mailing list