I'm trying to make a sort of recycling bin. I have a delete function which sends the selected file to the recycling bin and adds the location of the directory it was stored in to the file. The problem is when I obtain the location from the script using tail. Although the script works, it renames the file to tail. Could anyone explain why the cp is renaming the file? Here is a snippet from where I believe the problem is:
destination=(tail $1 -n 1)
cp ~/Recycling/$1 $destination
rm ~/Recycling/$1
Thanks