[clug] Bashism desired

Carlo Hamalainen carlo.hamalainen at gmail.com
Mon Mar 11 19:55:18 MDT 2013

On Tue, Mar 12, 2013 at 11:47 AM, Scott Ferguson <
scott.ferguson.clug at gmail.com> wrote:

> 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

This is between two different directories, i.e.

cp dir1/some_file dir2/some_file.variation ?

Not sure, but if dir1 == dir2 then the {,} trick works.

-- Carlo

More information about the linux mailing list