Daryl Thompson wrote:
############################################################# # Move the conversion process into a function that can # be called. # The "&&" makes it so each step must be successful before
No, the && will not work as written. It must be used as a conjunction on one command line, as in the following example: mplayer blah && lame goop
# the next step will be done. ############################################################# function wma2mp3 () { if [ ! -f "$1" ]; then echo "File $1 not found!" else mplayer -ao pcm:file="${1%%.[Ww][Mm][Aa]}.wav" "$1" && lame -h -b 192 "${1%%.[Ww][Mm][Aa]}.wav" "${1%%.[Ww][Mm][Aa]}.mp3" &&
The above && will not work as intended. Rather, you will see an error: -bash: syntax error near unexpected token `&&'
rm -f "${1%%.[Ww][Mm][Aa]}.wav" || echo "There was a problem with the conversion process!" fi }
HTH cheers rick p.s. as other posters have pointed out, "find" is your friend -- _________________________________ Rick Welykochy || Praxis Services Once a new technology starts rolling, if you're not part of the steamroller, you're part of the road. -- Stewart Brand -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html