Friday, October 22, 2010

shell command line looping (tested on cygwin)


% for file in *.bar ; do > echo $file > 
mv $file `echo $file | sed 's/\.bar$/.foo/'` > done
% for file in `cat file_list` ; do > echo $file >
mv `echo $file | sed 's/\\r//'` `echo $file | sed 's/\.bar$/.foo/'` > done

No comments:

Blog Archive