For with Slight Extra Commands
This generates EXIF data from JPEG files
Trapping the time command
time is a very useful command to see how things are going. However this does not worktime ps -ef | grep real
This is because time sends the output to stderr (channel 2) ... so we need some shell trickery....(time (perl t_mem.pl 10k.xml > /dev/null) 2>&1 ) | grep real
and in a script this will becometaken=$((time (perl t_mem.pl 10k.xml > /dev/null) 2>&1 ) | grep real) echo "It took "$taken" to do that command"
This example uses HandBrake