DEV Community

Discussion on: 5 Handy Bash Tricks in 2 Minutes

Collapse
 
andyyaldoo profile image
Andy Aldo Dharmawan • Edited

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}

?

Collapse
 
learnbyexample profile image
Sundeep

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
Collapse
 
jacobherrington profile image
Jacob Herrington (he/him)

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