Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help processing a listfile through a script

Status
Not open for further replies.

nixdy

ISP
Oct 12, 2006
1
GB
I have created the following script to sleep batch jobs.

echo "Please enter job name"
read Penter
echo "#!/bin/ksh" > $Penter
echo "sleep 5" >> $Penter
echo "exit 0" >> $Penter

It is run as follows
clarence:/export/home/ecop004/test_area>test adwr6011

output is
clarence:/export/home/ecop004/test_area>more adwr6011
#!/bin/ksh
sleep 5
exit 0

What I would like to do is run the above script but so it pickes the filenames up form a list file. So I don't have to maually put in the job name each time

Kind Regards



Is this possible.
 
while read LINE
do
echo "#!/bin/ksh" > $Penter
echo "sleep 5" >> $Penter
echo "exit 0" >> $Penter
done < outputfile

Where LINE is from outputfile list of filenames.

Alan Bennett said:
I don't mind people who aren't what they seem. I just wish they'd make their mind up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top