1
2
3
4
5
6
7
8
9
10
11
12
13
14 | #! /usr/bin/env bash USAGE="$0: /path/to/APEFile" if [ $# -lt 1 ]; then echo -e "Error: Ensure that you're supplying the path to your .APE file.\n$USAGE" >&2; exit 1; fi shnsplit -f "$file" -o "flac flac -V --best -o %f -" "$1" -t "%n - %t" 2>&1 | \ gawk -vvar=$tracks 'NR>=1 && NR<=var {print "#Track ",NR," of ", var;print (NR-1)*100/var};{fflush();}' | \ (if $(zenity --title="Splitting Tracks..." --progress --auto-close --percentage=0); then echo 'done' else killall shnsplit exit 1 fi) |