I wrote a bash script:
date=$( date +%F )
cp $1 $1_$date
When written this way and provided a single argument, it works fine. But if I write:
cp $1 $date_$1
I get an error message:
cp: ‘1.sh’ and ‘1.sh’ are the same file
Could someone explain to me, please, why it happens and how it can be solved. Thanks!