1

MV command giving me are the same file error

view story
linux-howto

http://stackoverflow.com – So I am building this script to take a file from the "trash" directory and move it to the home directory. I am getting an error mv:/home/user/Trash/ and /home/user/Trash are the same file. The problem is I am moving the file to /home/user. I can't figure out why it is giving me this error. Script: trash="/home/user/Trash" homedirectory="/home/user/" for files in "$trash"/* do echo "$(basename $files) deleted on $(date -r $files)" done echo "Enter the filename to undelete from the above list:" read $undeletefile mv $trash/$undeletefile $homedirectory Output: myfile2 deleted on Thu Jan 23 1 (HowTos)