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

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User