
On Sat, 2005-04-09 at 11:38 +1200, Bnonn wrote:
Stink. I wasn't game enough to give it a go. What's the point of demarcating things if the command doesn't recognize the demarcation though...?
For one, it is bash that you're telling special things to when you quote strings, not the command you're passing arguments too. In the previous case rm would just have received the string -rf (without quotes) as argv [1]. The only reason to quote arguments is to ensure special characters are not misinterpreted by your shell. eg: rm "file with spaces.txt" or rm 'file with $sign and spaces.txt' or rm 'file with bang!.txt' An alternative to quoting is escaping. Eg: rm file\ with\ bang\!.txt You will find that bash does this by default if you tab complete a file with a funny name like the above. The difference between " (double) and ' (single) quotes is that with double quotes your shell will interpolate environment $vars and other shell special characters. Eg: $ echo "There's no place like $HOME." There's no place like /home/oliver. Where as with single quotes this doesn't happen. $ echo 'There is no place like $HOME.' There is no place like $HOME. Of course all of this is only guaranteed to apply to bash, my shell of choice. Regards -- Oliver Jones » Roving Code Warrior oliver(a)deeperdesign.com » +64 (21) 41 2238 » www.deeperdesign.com