#!/bin/sh _printhelp () { cat<$(tput sgr0) $file" [ $CPUNO -eq 1 ] && "${0%/*}"/tc-audio-transcode "$@" "$file" || \ tc-audio-transcode -q "$@" "$file" >/dev/null fi done IFS=$OLDIFS echo "$(tput setf 5)$(tput bold)::$(tput sgr0) Thread $CORE/$CPUNO terminated." } FILENO=$(echo "$INPUT" | wc -l) if [ $CPUNO -gt $FILENO ]; then CPUNO=$FILENO fi for i in $(seq 2 $CPUNO); do _worker $i "$@" & done ## We run one worker in the current process so that this script will hopefully ## terminate when the last job finishes. _worker 1 "$@"