simple bash scripting
Hey all. I can program in C++ and Java, so methods and conditionals and loops come naturally to me, so this is mainly a question of syntax.
I have a whole bunch of files in a directory, they are ".avi" files. I want to run ffmpeg on each one and convert them to an ".mpg" file. I already have the ffmpeg all set up, but only to take one file at a time. My bash script looks like this so far:
Code:
for file do
echo $file
# newname=???
echo $newname
done
all I need to do is take file, which will be something like "movie.avi" and set newname to "movie.mpg" so that I can pass the two variables into my ffmpeg command.
I think I need sed or awk or grep or something but I dont know.
Knowledge is half the battle.
The other half is violence!
Bookmarks