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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make script that check/unpack file10 and then file11 ?

Status
Not open for further replies.

Madz

Technical User
Jan 31, 2001
33
0
0
SE
Is it possible to make a script that check if I have received file100.gz and then unpack it.

The next time it should check if file101 have arrived and then unpack it (and so on). If not it should mail root.

How do I make this in a script?

Thanks in advance!

/mats
 
x=100

while :
do
if [ -r file${x}.gz ]
then
gunzip file${x}.gz
x=`expr $x + 1`
fi
sleep 60
done

This should give you a starting point.

Bill.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top