18th July 2008, 11:21 pm
I keep forgetting the syntx for while read.
essentially, you pipe a bunch of lines into it, and then it’ll process each line e.g.:
$find ~/video -iname ‘*avi’ -or -iname ‘*mpeg’ | while read movie ; do
mencoder [encoding options...] “$movie” -o ~/converted/`basename
“$movie”` ; done
Yay.
Leave a comment
use html pre or code tags for code