Skip to content

Instantly share code, notes, and snippets.

@rochefort
Created February 1, 2017 08:36
Show Gist options
  • Save rochefort/9e85e0ecd44da807fb15d9d2c279b9d2 to your computer and use it in GitHub Desktop.
Save rochefort/9e85e0ecd44da807fb15d9d2c279b9d2 to your computer and use it in GitHub Desktop.
double cp
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