The destination directory is a directory with spaces in the name: /opt/config/Sn Lk
Now I wrote a script which moves a file from my directory to this directory, but the move fails
Although the echo of the command seems to be fine
workdir=/home/mydir
destdir="'opt/config/Sn Lk"
file=Al_10.txt
destination="$destdir/$file'"
echo "command = mv -v $workdir/$file $destination"
mv -v $workdir/$file $destination
result:
command = mv -v /home/mydir/Al_10.txt '/opt config/Sn Lk/Al_10.txt'
mv: target ‘Lk/Al_10.txt'’ is not a directory
How should the move-command be written?
destdir="'
– Artem S. Tashkinov Dec 15 '22 at 14:57destination
variable, probably in the hope to protect the spaces in the directory names. – AdminBee Dec 15 '22 at 15:04mv
command. See also the questions and answers marked as dupes. – Kusalananda Dec 15 '22 at 15:34