Skip to content

Instantly share code, notes, and snippets.

@iluvcapra
Created November 29, 2009 17:34
Show Gist options
  • Save iluvcapra/244987 to your computer and use it in GitHub Desktop.
Save iluvcapra/244987 to your computer and use it in GitHub Desktop.
#!/bin/sh
for file ; do
NEW_FILENAME=`echo "$file" | ruby -e "puts STDIN.read.scan(/(.*)\.flac$/)"`
flac -d --keep-foreign-metadata "$file" -o "$NEW_FILENAME" 2>/dev/null
if [ -e "$NEW_FILENAME" ]
then
echo Successfully "de-FLAC'd" $file
rm "$file"
else echo Failed to inflate $file as $NEW_FILENAME
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment