run program multiple times using one line shell command

Posted by teehoo on Stack Overflow See other posts from Stack Overflow or by teehoo
Published on 2010-05-02T17:52:50Z Indexed on 2010/05/02 17:57 UTC
Read the original article Hit count: 271

I have the following gifs on my linux system:

$ find . -name *.gif
./gifs/02.gif17.gif
./gifs/fit_logo_en.gif
./gifs/halloween_eyes_63.gif
./gifs/importing-pcs.gif
./gifs/portal.gif
./gifs/Sunflower_as_gif_small.gif
./gifs/weird.gif
./gifs2/00p5dr69.gif
./gifs2/iss013e48788.gif
...and so on

What I have written is a program that converts GIF files to BMP with the following interface:

./gif2bmp -i inputfile -o outputfile

My question is, is it possible to write a one line command using xargs, awk, find etc. to run my program once for each one of these files? Or do I have to write a shell script with a loop?

© Stack Overflow or respective owner

Related posts about shell-scripting

Related posts about command-line