Couple of bash questions

JoeHill joehill-R6A+fiHC8nRWk0Htik3J/w at public.gmane.org
Sun Oct 28 16:34:53 UTC 2007


Dave Mason wrote: 

> renaming away extra .blah before final extension:
>    mv "$i" "`echo X $i|sed 's/^X \([^.]*\).*\(\.[^.]*\)$/\1\2/'`"

Ah, okay, so I don't even have to bother with the special chars.
 
> the \. means use the . as a ..

Perhaps I am using this incorrectly, but I get:

[joehill at node1:test>$]mv "$i" "`echo X $i|sed 's/^X
\([^.]*\).*\(\.[^.]*\)$/\1\2/'`" * 
mv: target `rescue.me.306.ws.dsr-dimension.[VTV].avi' is not a directory

> resolving script problem:
> .... "`basename $i .avi`.mp4"
> 
> The double quotes cause it to be treated as a single token.

Thank you very much. Just out of curiosity, though, why does this work without
the quotes?:

for i in *.mp3; do lame --decode $i `basename $i .mp3`.wav; done;

-- 
JoeHill
++++++++++++++++++++
 Fry: Ooh, Big Pink. It's the only gum with the breath freshening power of ham.
 Bender: And it pinkens your teeth while you chew. 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://gtalug.org/pipermail/legacy/attachments/20071028/5af958a2/attachment.sig>


More information about the Legacy mailing list