pythagorasmk wrote:I get the error message from ffmpeg that */*.m4a does not exist
Can we see the exact message? Your line looks okay to me.
Bloom wrote:a very good Bash script
Not according to
https://www.shellcheck.net/:
Code: Select all
Line 55:
readonly PROG=$(basename $0)
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
readonly PROG=$(basename "$0")
Line 58:
TMP='/tmp'
^-- SC2034: TMP appears unused. Verify use (or export if used externally).
Line 120:
return $(test "$1" -eq "$1" > /dev/null 2>&1);
^-- SC2046: Quote this to prevent word splitting.
^-- SC2065: This is interpreted as a shell file redirection, not a comparison.
Line 219:
$SED -i "/ \w*: /w${TAGS2}" $TAGS
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$SED -i "/ \w*: /w${TAGS2}" "$TAGS"
Line 220:
$SED -i "s/^ //" $TAGS2
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$SED -i "s/^ //" "$TAGS2"
Line 221:
$SED -i "s/: /=/" $TAGS2
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$SED -i "s/: /=/" "$TAGS2"
Line 222:
$SED -i "s/ of [0-9]\+//" $TAGS2
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$SED -i "s/ of [0-9]\+//" "$TAGS2"
Line 223:
$SED -i "s/\(.*\)=/\U\1=/" $TAGS2
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$SED -i "s/\(.*\)=/\U\1=/" "$TAGS2"
Line 224:
$SED -i "s/TRACK=/TRACKNUMBER=/;s/YEAR=/DATE=/;s/COMMENTS=/DESCRIPTION=/;s/DISK=/DISCNUMBER=/" $TAGS2
>> ^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$SED -i "s/TRACK=/TRACKNUMBER=/;s/YEAR=/DATE=/;s/COMMENTS=/DESCRIPTION=/;s/DISK=/DISCNUMBER=/" "$TAGS2"
Line 225:
mv $TAGS2 $TAGS
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
mv "$TAGS2" "$TAGS"
Line 231:
$SED -i "/ = /w${TAGS2}" $TAGS
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$SED -i "/ = /w${TAGS2}" "$TAGS"
Line 232:
$SED -i "s/ = /=/" $TAGS2
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$SED -i "s/ = /=/" "$TAGS2"
Line 233:
$SED -i "s/\(.*\)=/\U\1=/" $TAGS2
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$SED -i "s/\(.*\)=/\U\1=/" "$TAGS2"
Line 234:
$SED -i "s/TRACK=/TRACKNUMBER=/;s/YEAR=/DATE=/;s/COMMENT=/DESCRIPTION=/;s/DISK=/DISCNUMBER=/" $TAGS2
>> ^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$SED -i "s/TRACK=/TRACKNUMBER=/;s/YEAR=/DATE=/;s/COMMENT=/DESCRIPTION=/;s/DISK=/DISCNUMBER=/" "$TAGS2"
Line 235:
mv $TAGS2 $TAGS
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
mv "$TAGS2" "$TAGS"
Line 243:
$APEINFO -t "$FILE" >$TAGS
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$APEINFO -t "$FILE" >"$TAGS"
Line 245:
$METAFLAC --export-tags-to=$TAGS "$FILE"
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$METAFLAC --export-tags-to="$TAGS" "$FILE"
Line 247:
$MP4INFO "$FILE" >$TAGS
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$MP4INFO "$FILE" >"$TAGS"
Line 250:
$WVUNPACK -qss "$FILE" >$TAGS
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$WVUNPACK -qss "$FILE" >"$TAGS"
Line 256:
if [[ $? -ne 0 || ! -s "$TAGS" ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Line 259:
$METAFLAC --import-tags-from=$TAGS "$NAME.flac"
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$METAFLAC --import-tags-from="$TAGS" "$NAME.flac"
Line 260:
if [[ $? -ne 0 ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Line 266:
rm $TAGS
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
rm "$TAGS"
Line 275:
if [ -n "$USEFFMPEG" ] && [ "$EXT" == "ape" -o "$EXT" == "m4a" -o "$EXT" == "mlp" -o "$EXT" == "shn" -o "$EXT" == "tak" -o "$EXT" == "wv" -o "$EXT" == "wma" ]; then
^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
>> ^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
>> ^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
>> ^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
>> ^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
>> ^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
Line 279:
-a $($FFMPEG -i "$FILE" 2>&1 | grep 'Stream.*Audio:' | grep wmalossless | wc -l) -lt 1 ]; then
^-- SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
^-- SC2046: Quote this to prevent word splitting.
>> ^-- SC2126: Consider using grep -c instead of grep|wc -l.
Line 284:
WAVENAME="/tmp/$(basename $NAME).wav"
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
WAVENAME="/tmp/$(basename "$NAME").wav"
Line 287:
eval $FFMPEG -i \"$FILE\" $CODEC -f wav \"$WAVENAME.wav\" $QUIET
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
eval "$FFMPEG" -i \""$FILE"\" "$CODEC" -f wav \""$WAVENAME".wav\" $QUIET
Line 288:
if [ $? -ne 0 ]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Line 293:
eval $FLAC -$COMPRESS $KEEPFOREIGN $OVERWRITE -o \"$NAME.flac\" \"$WAVENAME.wav\" $QUIET
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
>> ^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
eval "$FLAC" -$COMPRESS "$KEEPFOREIGN" "$OVERWRITE" -o \""$NAME".flac\" \""$WAVENAME".wav\" $QUIET
Line 294:
if [ $? -ne 0 ]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Line 307:
eval $MAC \"$FILE\" - -d $QUIET | $FLAC -$COMPRESS $KEEPFOREIGN $OVERWRITE -s -o "$NAME.flac" -
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
>> ^-- SC2086: Double quote to prevent globbing and word splitting.
>> ^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
eval "$MAC" \""$FILE"\" - -d $QUIET | $FLAC -$COMPRESS "$KEEPFOREIGN" "$OVERWRITE" -s -o "$NAME.flac" -
Line 313:
if [ $OVERWRITE ]; then
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
if [ "$OVERWRITE" ]; then
Line 324:
$FLAC -d "$FILE" $QUIET -c | $FLAC -$COMPRESS $KEEPFOREIGN $OVERWRITE -s -o "$NAME.flac" -
^-- SC2086: Double quote to prevent globbing and word splitting.
>> ^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$FLAC -d "$FILE" $QUIET -c | $FLAC -$COMPRESS "$KEEPFOREIGN" "$OVERWRITE" -s -o "$NAME.flac" -
Line 330:
if [ $? -ne 0 ]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Line 335:
$ALAC "$FILE" | $FLAC -$COMPRESS $KEEPFOREIGN $OVERWRITE $QUIET -o "$NAME.flac" -
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$ALAC "$FILE" | $FLAC -$COMPRESS "$KEEPFOREIGN" "$OVERWRITE" $QUIET -o "$NAME.flac" -
Line 340:
$SHORTEN -x "$FILE" - | $FLAC -$COMPRESS $KEEPFOREIGN $OVERWRITE $QUIET -o "$NAME.flac" -
^-- SC2086: Double quote to prevent globbing and word splitting.
>> ^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$SHORTEN -x "$FILE" - | $FLAC -$COMPRESS "$KEEPFOREIGN" "$OVERWRITE" $QUIET -o "$NAME.flac" -
Line 345:
eval $TTAENC -d -o - \"$FILE\" $QUIET | $FLAC -$COMPRESS $KEEPFOREIGN $OVERWRITE -s -o "$NAME.flac" -
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
>> ^-- SC2086: Double quote to prevent globbing and word splitting.
>> ^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
eval "$TTAENC" -d -o - \""$FILE"\" $QUIET | $FLAC -$COMPRESS "$KEEPFOREIGN" "$OVERWRITE" -s -o "$NAME.flac" -
Line 350:
$FLAC -$COMPRESS $KEEPFOREIGN $OVERWRITE $QUIET -o "$NAME.flac" "$FILE"
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$FLAC -$COMPRESS "$KEEPFOREIGN" "$OVERWRITE" $QUIET -o "$NAME.flac" "$FILE"
Line 355:
$WVUNPACK $QUIET "$FILE" -o - | $FLAC -$COMPRESS $KEEPFOREIGN $OVERWRITE -s -o "$NAME.flac" -
^-- SC2086: Double quote to prevent globbing and word splitting.
>> ^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
$WVUNPACK $QUIET "$FILE" -o - | $FLAC -$COMPRESS "$KEEPFOREIGN" "$OVERWRITE" -s -o "$NAME.flac" -
Line 360:
if [ ${PIPESTATUS[0]} -ne 0 ]; then
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
if [ "${PIPESTATUS[0]}" -ne 0 ]; then
Line 370:
if [ $COPYTAGS ]; then
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
if [ "$COPYTAGS" ]; then
Line 377:
read -e DELPROMPT
^-- SC2162: read without -r will mangle backslashes.
Line 436:
if [ $? -ne 0 ] || [ $COMPRESS -lt 0 -o $COMPRESS -gt 8 ]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
if [ $? -ne 0 ] || [ "$COMPRESS" -lt 0 -o "$COMPRESS" -gt 8 ]; then
Line 444:
if [ $? -ne 0 ] || [ $THREADS -lt 1 ]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
if [ $? -ne 0 ] || [ "$THREADS" -lt 1 ]; then
Line 447:
elif [ ${1:2} -gt $PROCS ]; then
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
elif [ "${1:2}" -gt "$PROCS" ]; then
Line 451:
elif [ "$DELETE" == "prompt" -a $THREADS -gt 1 ]; then
^-- SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
elif [ "$DELETE" == "prompt" -a "$THREADS" -gt 1 ]; then
Line 488:
[ "$DELETE" == "move" -a ! -e "$TPUT" ] && MISSING+='trash-put, '
^-- SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
Line 496:
for FILE in ${FILES[@]}; do
^-- SC2068: Double quote array expansions to avoid re-splitting elements.
Line 518:
if [ $(jobs | wc -l) -lt $THREADS ]; then
^-- SC2046: Quote this to prevent word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
if [ $(jobs | wc -l) -lt "$THREADS" ]; then
Line 521:
while [ $(jobs | wc -l) -ge $THREADS ]; do
^-- SC2046: Quote this to prevent word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
Did you mean: (apply this, apply all SC2086)
while [ $(jobs | wc -l) -ge "$THREADS" ]; do
Looks like Jared Breland needs to learn about
quoting and a few other things.