re: 5 Handy Bash Tricks in 2 Minutes VIEW POST

FULL DISCUSSION
 

For point number 2, does it expand to

cp /some/path/to/file.txt /some/path/to/file.bak

?

If so, shouldn't it be

cp /some/path/to/file{.txt,.bak}

?

 

I guess the author wished to only add a suffix, not change the extension itself.

$ echo /some/path/to/file.txt{,.bak}
/some/path/to/file.txt /some/path/to/file.txt.bak
 

Either one works here. I usually leave the original file extension on these!

code of conduct - report abuse