removing quotes when dragging files to the terminal
I also posted this under "programming", but I am not sure if it is a bash issue.
The following script will work when I type the path to the file I want to checksum, but not when I drag the file to the terminal because the linux terminal (unlike the Mac) automatically puts quotes around the file path, which causes an error. I did not find anything in gconf-editor or anywhere else to alter this behaviour, and my post in Launchpad is unanswered so far. (the script in itself is not very useful, I just stumbled upon this error when experimenting with bash).
#!/bin/bash -x ## the x is just for debugging
echo 'paste the md5sum from the source website here:'
echo 'type path to file here:'
read NAME ## fails when I drag
if [ "$SHOULD" = `openssl dgst -md5 < $NAME` ]; then ## "$NAME" amounts to the same
echo 'verify failed!'
So, is there a workaround for stripping the quotes from the input, or can I configure the terminal to not quote the input when I drag a file into it (which I would prefer?)
I am currently logged in from Mac OS, but the question refers to ubuntu karmic with which I dual boot.
ADMINISTRATORS: Thanks for the quick reply to my newbie question about posting new threads. Actually I don't see now what the difficulty was; I guess I was tired from trying to debug the above script (not funny).