[Techtalk] recording music CDs- batch conversions
dominik.schramm at gmxpro.net
dominik.schramm at gmxpro.net
Tue Mar 9 14:57:38 EST 2004
Hi,
John Clarke <johnc+linuxchix at kirriwa.net> writes:
> On Mon, Mar 08, 2004 at 10:17:57AM -0800, Carla Schroder wrote:
> [...]
>> $ for i in 'ls *.au';do echo -e "$i";sox $i.cdr;done
These are backticks ` ` I suppose:
for i in `ls *.au` does nothing more than for i in *.au
>
> [...]
> for i in `ls -1 *.au|cut -d. -f1`
> do
> echo $i
> sox $i.au $i.cdr
> sox $i.cdr $i.wav
> done
If the shell is Bash, might I suggest:
for i in *.au
do
echo $i
sox $i ${i%.au}.cdr
sox ${i%.au}.cdr ${i%.au}.wav
done
or:
for i in *.au
do
FILE=${i%.au}
echo $FILE
sox ${FILE}.au ${FILE}.cdr
sox ${FILE}.cdr ${FILE}.wav
done
The ${i%xyz} notation cuts off "xyz" from the right side of $i.
cut -d. -f1 returns everything up to the first dot. If there
are multiple dots in the file name, it fails.
regards
dominik
--
Dominik Schramm <dominik.schramm at gmxpro.net>
pgp key via http://www.cam.ac.uk.pgp.net/pgpnet/wwwkeys.html
More information about the Techtalk
mailing list