3
バッチスクリプトを作成してオーディオファイルを圧縮しようとしていて、本当に奇妙な問題に直面しています。ここで理由なしでBash 19の文字が消える
は私のコードです:
#!/bin/bash
qscale=$1
input=$2
output=$3
inputSize=$((${#input}+1))
find "$input" -type f -name "*.flac" -print0 | while read -d $'\0' a
do
path=${a:inputSize}
echo "Working on $path"
# ffmpeg -i "$a" -qscale:a $qscale "$output/${path[@]/%flac/mp3}" &>/dev/null
done
ここ
は、結果の例である:
Working on 09 - Groove #2 (instrumental studio outtake).flac
Working on 07 - Blues for Allah Sand Castles and Glass Camels Unusual Occurrences in the Desert.flac
Working on 12 - Proto 18 Proper (instrumental studio outtake).flac
Working on 04 - The Music Never Stopped.flac
Working on 13 - Hollywood Cantana (studio outtake).flac
...
私はffmpeg
行のコメントを解除した場合、ここでは同じフォルダの結果である:
Working on 09 - Groove #2 (instrumental studio outtake).flac
Working on h Sand Castles and Glass Camels Unusual Occurrences in the Desert.flac
Working on 12 - Proto 18 Proper (instrumental studio outtake).flac
Working on r Stopped.flac
Working on 13 - Hollywood Cantana (studio outtake).flac
...
は、
2つのファイルのうち1つが、19番目の最初の文字を見逃しています!そしてなぜ私は考えていない。