[ale] Keep space separated values sane in a bash "for" loop?

James P. Kinney III jkinney at localnetsolutions.com
Thu Apr 5 22:12:15 EDT 2007


On Thu, 2007-04-05 at 20:13 -0400, aaron wrote:

> #!/bin/bash
> # Creates new mp3 encoded files for all standard
> # .aif, .aiff and .wav TAGged files found in current directory
> 
> TAGS=".aif .aiff .wav .AIF .AIFF .WAV"
> OTAG=".mp3"
> for TAG in $TAGS
> do
>    ls -1 | grep "$TAG$" |
>    while read IFYL
>    do
>       OFYL=${IFYL/%$TAG/$OTAG}
>       echo "Encoding \"$IFYL\" to \"$OFYL\" "
>       lame -b 192 "$IFYL" "$OFYL"
>    done
> done
> 
> exit 0

And Aaron has complained about _my_ perl code looking like chickens
dancing in ink across the screen....

:)

OK. So it was _drunk_ chickens staggering across the screen...


> peace
> aaron
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
-- 
James P. Kinney III          
CEO & Director of Engineering 
Local Net Solutions,LLC        
770-493-8244                    
http://www.localnetsolutions.com

GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics)
<jkinney at localnetsolutions.com>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part




More information about the Ale mailing list