bash - Copy a file from argument and rename - Ask Ubuntu
hello realize may simple cannot figure out how copy file input parameters inside script. want take input , copy existing file , add .bak it. have far.
#!/bin/bash $1 cp $1 $1.bak
that $1
in second line shouldn't there, cp "$1" "$1".bak
should work fine. remember quote variables, spaces , other special characters don't create problems.
Comments
Post a Comment