mktar: Use `wc` instead of `du` in summary message
[sunny256-utils.git] / flac_to_ogg
blob5d4073bde1c74e94f5c57fc8c8cbd11ea2a239b9
1 #!/usr/bin/env bash
3 # flac_to_ogg
4 # File ID: 5a4e814e-5d3a-11df-a4ca-90e6ba3022ac
5 # Konverterer alle *.flac-filene til ogg i en egen katalog.
7 KVAL=6
9 [ -d "ogg" ] || mkdir ogg || { echo "Klarte ikke mkdir ogg" >&2; exit 1; }
10 for f in *.flac; do
11 if [ -e "$f" ]; then
12 echo $f;
13 flac -d <"$f" | oggenc -q$KVAL -c "encoding=OggEnc v0.9 (libvorbis rc3) CVS-20020523 -q$KVAL" -o $(echo ogg/$f|perl -pe "s/\\.flac\$//" |tr ' ' _).q$KVAL.ogg -
14 else
15 echo $f finnes ikke. Driter i den.
17 done