Created
February 1, 2017 08:36
-
-
Save rochefort/9e85e0ecd44da807fb15d9d2c279b9d2 to your computer and use it in GitHub Desktop.
double cp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function double_cp () { | |
f=$1 | |
bk=${1}_bk | |
tmp=${f}_xxxxxx | |
cp $f ${bk} | |
cat ${f}* > ${tmp} | |
rm -f ${bk} | |
rm -f $f | |
mv ${tmp} $f | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment