The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
Scripts / handy tips
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 Process a bunch of files through the same script
Author: Dan 
Date:   23-01-12 03:11

Today I had need to this trick:

$ FILES=`ls ~/tmp/msgs/*.xml`
$ echo $FILES
/home/dan/tmp/msgs/2012.01.22.06.01.30.73359.txt.xml /home/dan/tmp/msgs/2012.01.22.08.06.59.26507.txt.xml /home/dan/tmp/msgs/2012.01.22.10.16.48.3866.txt.xml /home/dan/tmp/msgs/2012.01.22.10.24.36.6278.txt.xml /home/dan/tmp/msgs/2012.01.22.10.42.16.13174.txt.xml /home/dan/tmp/msgs/2012.01.22.10.58.04.18864.txt.xml /home/dan/tmp/msgs/2012.01.22.10.58.48.18945.txt.xml /home/dan/tmp/msgs/2012.01.22.11.01.57.20624.txt.xml /home/dan/tmp/msgs/2012.01.22.11.16.14.27391.txt.xml /home/dan/tmp/msgs/2012.01.22.11.21.02.29233.txt.xml /home/dan/tmp/msgs/2012.01.22.11.34.46.33917.txt.xml /home/dan/tmp/msgs/2012.01.22.11.36.24.34899.txt.xml /home/dan/tmp/msgs/2012.01.22.11.58.39.42833.txt.xml
$ for file in $FILES
> do
> perl load_xml_into_db.pl ${file} > "${file}.loading"
> done
$

--
Webmaster

 Reply To This Message  |  Forum List  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 Process a bunch of files through the same script   new
Dan 23-01-12 03:11 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org