generated from me/template-mit
pv-test, fix broken loop variable, change loop guess to be multiplication rather than actual loops, add loop counter to output.
This commit is contained in:
+22
-23
@@ -934,32 +934,32 @@ function pv-test {
|
|||||||
echo -e " * Testing with 'pv2' complete! * \n"
|
echo -e " * Testing with 'pv2' complete! * \n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# TBD - Do multiplication with `wc` rather than a loop here.
|
typeset -i guess
|
||||||
count=0
|
guess=$(( \
|
||||||
|
`wc -w <<< $vcodecs` * `wc -w <<< $vpresets` * `wc -w <<< $crfs` \
|
||||||
|
* `wc -w <<< $vbrs` * `wc -w <<< $overs` * `wc -w <<< $unders` \
|
||||||
|
* `wc -w <<< $acodecs` * `wc -w <<< $abrs` \
|
||||||
|
* `wc -w <<< $achannels` * `wc -w <<< $afreqs` \
|
||||||
|
))
|
||||||
|
if (( $guess > 0 )); then
|
||||||
|
plural=""
|
||||||
|
if (( $guess != 1 )); then
|
||||||
|
plural="s"
|
||||||
|
fi
|
||||||
|
echo -e "Expecting ${guess} loop${plural}, please be patient.\n"
|
||||||
|
else
|
||||||
|
echo "ERROR: Something went wrong, got 0 loops, exiting."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
typeset -i count
|
||||||
|
unset vcodec vpreset crf vbr acodec abr ext
|
||||||
for vcodec in $vcodecs; do for vpreset in $vpresets; do for crf in $crfs; do
|
for vcodec in $vcodecs; do for vpreset in $vpresets; do for crf in $crfs; do
|
||||||
for vbr in $vbrs; do for over in $overs; do for under in $under; do
|
for vbr in $vbrs; do for over in $overs; do for under in $unders; do
|
||||||
for acodec in $acodecs; do for abr in $abrs;
|
for acodec in $acodecs; do for abr in $abrs;
|
||||||
do for achannel in $achannels; do for afreq in $afreqs; do
|
do for achannel in $achannels; do for afreq in $afreqs; do
|
||||||
for ext in $exts; do
|
for ext in $exts; do
|
||||||
(( count++ ))
|
(( count++ ))
|
||||||
done
|
|
||||||
done done
|
|
||||||
done done
|
|
||||||
done done done
|
|
||||||
done done done
|
|
||||||
plural=""
|
|
||||||
if (( $count != 1 )); then
|
|
||||||
plural="s"
|
|
||||||
fi
|
|
||||||
echo -e "Expecting ${count} loop${plural}, please be patient.\n"
|
|
||||||
|
|
||||||
count=0
|
|
||||||
unset vcodec vpreset crf vbr acodec abr ext
|
|
||||||
for vcodec in $vcodecs; do for vpreset in $vpresets; do for crf in $crfs; do
|
|
||||||
for vbr in $vbrs; do for over in $overs; do for under in $under; do
|
|
||||||
for acodec in $acodecs; do for abr in $abrs;
|
|
||||||
do for achannel in $achannels; do for afreq in $afreqs; do
|
|
||||||
for ext in $exts; do
|
|
||||||
|
|
||||||
preset=""
|
preset=""
|
||||||
if [[ "$vpreset" != "default" ]]; then
|
if [[ "$vpreset" != "default" ]]; then
|
||||||
@@ -1048,7 +1048,7 @@ function pv-test {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
newfile="_${size_in}p_${vcodec}-${vpreset}-${crf}-${vbr}${ofn}${ufn}_${acodec}-${abr}-${achannel}-${afreq}.${ext}"
|
newfile="_${size_in}p_${vcodec}-${vpreset}-${crf}-${vbr}${ofn}${ufn}_${acodec}-${abr}-${achannel}-${afreq}.${ext}"
|
||||||
echo -e " * Parameters for this test: $newfile * \n"
|
echo -e " * [Loop $count/$guess] Parameters for this test: $newfile * \n"
|
||||||
|
|
||||||
if [[ -e "$newfile" ]]; then
|
if [[ -e "$newfile" ]]; then
|
||||||
mv -v "$newfile" ~/TRASH/
|
mv -v "$newfile" ~/TRASH/
|
||||||
@@ -1092,7 +1092,6 @@ function pv-test {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\n * Finished in ${minutes}m${seconds}s! * \n"
|
echo -e "\n * Finished in ${minutes}m${seconds}s! * \n"
|
||||||
(( count++ ))
|
|
||||||
done
|
done
|
||||||
done done
|
done done
|
||||||
done done
|
done done
|
||||||
|
|||||||
Reference in New Issue
Block a user