roberts


Group: Members
Posts: 4983
Joined: Oct. 2003 |
 |
Posted: April 13 2008,17:32 |
 |
Just to answer the original question, I find myself typing loops on the command line to process lists. Example:
# for F in `cat myfiles.lst`; do echo "$F"; done
This just echos back your list to insure that the loop is typed correctly.
I always start with a simple echo; just to be sure.
Sometimes I am paranoid and will then replace the echo with ls -1 to be sure that files that I think I am going to be processing are really there.
Then when I calm down I replace the command (echo or ls -1) with the actual command I wish to perform, usually sed -i, tr,awk, or rm
I know many times one could use find together with -exec, but that is not always available, so too, one could use find with xargs but I still uses loops on the command line.
|