jamesisin
March 3rd, 2010, 09:54 PM
I am writing a script to convert album APE files into track FLAC files recursively in a folder hierarchy. At first I tried this:
# split album APE into track FLAC files
# assumes all .ape and .cue files are named a
# recursive
printf "%b\n\n" "I will need to know from which directory to recurse.\n"
read -p "Give the path to the root of the problem: "
for filelist in "${REPLY[@]}"; do
find
aflac=()
for albumflac in "${filelist[@]}"; do
read -r
done << grep a.flac
acue=()
for albumcue in "${filelist[@]}"; do
read -r
done << grep a.cue
shnsplit -o flac -f "${albumcue[@]}" -t "%n - %t" "${albumflac[@]}"
done
This gave me errors, so I used this instead:
# split album APE into track FLAC files
# assumes all .ape and .cue files are named a
# recursive
printf "%b\n\n" "I will need to know from which directory to recurse.\n"
read -p "Give the path to the root of the problem: "
for filelist in "${REPLY[@]}"; do
find
aflac=()
for albumflac in "${filelist[@]}"; do
grep a.flac
done
acue=()
for albumcue in "${filelist[@]}"; do
grep a.cue
done
shnsplit -o flac -f "${albumcue[@]}" -t "%n - %t" "${albumflac[@]}"
done
This gave no errors but did no useful work and hung after the find listed its files.
Oh, and find runs recursive from the pwd and not the $REPLY directory.
Am I close?
# split album APE into track FLAC files
# assumes all .ape and .cue files are named a
# recursive
printf "%b\n\n" "I will need to know from which directory to recurse.\n"
read -p "Give the path to the root of the problem: "
for filelist in "${REPLY[@]}"; do
find
aflac=()
for albumflac in "${filelist[@]}"; do
read -r
done << grep a.flac
acue=()
for albumcue in "${filelist[@]}"; do
read -r
done << grep a.cue
shnsplit -o flac -f "${albumcue[@]}" -t "%n - %t" "${albumflac[@]}"
done
This gave me errors, so I used this instead:
# split album APE into track FLAC files
# assumes all .ape and .cue files are named a
# recursive
printf "%b\n\n" "I will need to know from which directory to recurse.\n"
read -p "Give the path to the root of the problem: "
for filelist in "${REPLY[@]}"; do
find
aflac=()
for albumflac in "${filelist[@]}"; do
grep a.flac
done
acue=()
for albumcue in "${filelist[@]}"; do
grep a.cue
done
shnsplit -o flac -f "${albumcue[@]}" -t "%n - %t" "${albumflac[@]}"
done
This gave no errors but did no useful work and hung after the find listed its files.
Oh, and find runs recursive from the pwd and not the $REPLY directory.
Am I close?