Couple of bash questions

JoeHill joehill-R6A+fiHC8nRWk0Htik3J/w at public.gmane.org
Sun Oct 28 15:33:08 UTC 2007


I'm pretty fond of automating things, and I've always been able to find little
bits here and there that have made things quicker, but this one bugs me still,
like my beloved 'rmsp' which removes spaces and capitals in filenames.

1. A lot of files I download have these annoying additions to their filenames
like 'something.[someguysinitials].avi'. What I would like to do is remove the
[someguysinitials] and either the preceding or following '.', however the batch
rename in my file manager will not let me specify the '.' (it might if I knew
how to use regex....).

2. I came up with this to do batch conversions of avi to mp4 using ffmpeg:

for i in *.avi; do ffmpeg -i $i -f mp4 -vcodec mpeg4 -b 1200kb -qmin 3 -qmax 5
-g 300 -acodec libfaac -ab 192kb -s 320x180 -aspect 16:9 `basename
$i .avi`.mp4; done;

and it works, but it does give me some grief at the end:

/home/joehill/bin/ipodenc_batch: line 2: syntax error near unexpected token
`done' 
/home/joehill/bin/ipodenc_batch: line 2: `4; done;'

I've adapted this from a line I use to do mp3 to wav using lame, so I'm
thinking it has to do with the fact that the syntax for ffmpeg and lame are
quite different (position of input files vs. output files), but I don't know
enough, clearly, to see what exactly.

-- 
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/8c63ba42/attachment.sig>


More information about the Legacy mailing list