Skip to content

Commit

Permalink
fix recursive file finder with extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymoulin committed Aug 10, 2017
1 parent 6277eaa commit 2903354
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

trap 'exit 2' TERM INT

for f in /media/**/*.{avi,ogm,wmv}; do
shopt -s globstar
shopt -s nullglob
for f in **/*.{avi,ogm,wmv}; do
printf '\033[1;34;40m'
echo "Converting $f"
printf '\033[0m'
avconv -i "$f" -strict experimental -c:v libx264 "${f%.avi}.mp4" && rm "$f"
done
for f in /media/*.{avi,ogm,wmv}; do
printf '\033[1;34;40m'
echo "Converting $f"
printf '\033[0m'
avconv -i "$f" -strict experimental -c:v libx264 "${f%.avi}.mp4" && rm "$f"
avconv -i "$f" -strict experimental -c:v libx264 "${f:0:-4}.mp4" && rm "$f"
done

0 comments on commit 2903354

Please sign in to comment.