help with sed

Dave Mason dmason-bqArmZWzea/GcjXNFnLQ/w at public.gmane.org
Sat Jun 16 04:40:34 UTC 2007


I don't know what all those backslashes are for:

; f='a b c.wav'
; echo `echo $f | sed 's/\\\\\\\\.wav$$//'`.mp3
a b c.wav.mp3
; ls -l `echo $f | sed 's/\\.wav$//'`.mp3
ls: a: No such file or directory
ls: b: No such file or directory
ls: c.mp3: No such file or directory
; ls -l "`echo $f | sed 's/\\.wav$//'`.mp3"
ls: a b c.mp3: No such file or directory

So the answer is to put " around the backquotes.

../Dave

--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list