Tuesday, August 3, 2010

Loop over a files in directory in shell



#!/bin/sh

for f in `ls`

do

echo “Processing $f file …”

#Here you can put your commands

done


You can loop over files with specific names changing ls to ie. ls *.txt etc.

No comments:

Post a Comment