krypted.com

Tiny Deathstars of Foulness

When I’m working on a little bash script, I’ll often make a backup, each time I save and test. Then I can revert back, if I need to. The syntax I’ll use is to cp and then curly-bracket the output into .bak files (that’s a 90s era file extension I use for such nonsense):

cp filename.sh{,.bak}

So if I’m writing a script called MYSCRIPT.sh:

cp MYSCRIPT.sh{,.bak}

The resultant backup of the script is MYSCRIPT.sh.bak.

March 22nd, 2016

Posted In: Mac OS X, Unix

Tags: , , ,