Hello,

Somthing like this should work in BASH:


cd /usr/home
for name in *
do
  cat /usr/home/$name/file | filter > /home/$name/file2
done

The above hypothetical assumes that all the files in /usr/home are home
directories, that the file names "file" and "file2" are the same for every
user, that your filter program reads standard in and writes to standard out,
and that the target directory /home/$name exists. But you can add other
statements and checks to the loop to accomodate other requirements.

If you wish to work from a list of names in a file, then you can do this:

for name in `cat filelist`
do
  cat /usr/home/$name/file | filter > /home/$name/file2
done


> ----------
> From:         TAG[SMTP:[EMAIL PROTECTED]]
> Sent:         Thursday, January 27, 2000 4:11 AM
> To:   Linux Newbie
> Subject:      scripting hassels
> 
> HI ALL,
> 
> I have a problem and very tedious problem.  I have to convert files from
> one format to another for files in different directories:
> 
> ie: /usr/home/<user>/file needs to be converted with a program "convert"
> into /home/<user>/file2 - but I have over 3000 users??
> 
> Is there a simple script that will read from a file that lists all the
> users and place's their name into the right place and automates the whole
> thing??
> 
> PLEASE HELP - I hate to have to do it all by hand??
> 
> MANY thanks
> 
> --Tonino
> 

Reply via email to