Waiting for a file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Waiting for a file
# 1  
Old 11-19-2009
Waiting for a file

I am such a newbie. I am from a mainframe background, so this stuff is new for me to interpret. I dont know if I need a sleep or wait.
I need a loop to wait for a filea or fileb to be created before I execute further script. The driver unix script is on the solaris. The files I'm looking for are on a NT server.

Thanks.
# 2  
Old 11-19-2009
Wait is is used to wait for background process that were started from your own environment. You do not need an explicit loop.

The sleep statement can be used inside a loop that checks for some external event to happen. It is just a pause statement to keep the script from munching all of the cpu (core) resources.

You situation is an example of the second case.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

[Solved] Check for a file and keep waiting for 30 mins

Hi All! I want to have a shell script that checks for a file in a particular folder and then if the file is not found it should wait for 30 minutes. Again check for the file, if it FOUND then successfuly exit the shell script stating the file is found. Else it should continue to wait. ... (4 Replies)
Discussion started by: akshay01987
4 Replies

2. HP-UX

Some I/O requests to this LV are waiting

Hi All I have a blade BL860c running on a C7000 chassis, in which is connected to a NetApp, so lately I am having I/O issues, and dmesg as well as syslog.log is reporting the following: /dev/vg01/lvol2 file system file data error in dev/block 0/55892768 Page I/O error occurred while paging... (2 Replies)
Discussion started by: fretagi
2 Replies

3. Shell Programming and Scripting

not waiting...why?

My shell script is not waiting. I right click on a file and say convert it to whatever and it runs this script. It converts it using Compressor but I want it to wait until it is 100% done before moving on and it is not waiting. I have tried to put it in the background and using "wait". I have tried... (10 Replies)
Discussion started by: mainegate
10 Replies

4. Shell Programming and Scripting

not waiting

I have a script that runs Compressor and converts the file then I want it to inject the file with Flvtool2. My script works fine but the flvtool2 is starting too early. I have tried to put it in the background by putting a "&" sign at the end and then put a "wait" on a new line. Anyone have any... (2 Replies)
Discussion started by: mainegate
2 Replies

5. Shell Programming and Scripting

waiting until file loaded

Hello i have DB file load with this command ../SS-Tools/SSdbload -r 10 -il /export/specbackup_db/$b y i should wait until the DB load completed then run the next command $SPECROOT/bin/launchinstdbapp `/usr/bin/hostname` SS n VNM.OUT how this can be done with shell scripting NB: i... (1 Reply)
Discussion started by: mogabr
1 Replies

6. Shell Programming and Scripting

waiting

I have a text file which contain all the parameters need for scheduled jobs, then this "control" script would be called everynight at certain time while read line do $myScript.sh $line & pid=$! i=`expr $i + 1` done < $list then I need to wait until all... (1 Reply)
Discussion started by: mpang_
1 Replies

7. UNIX for Dummies Questions & Answers

Waiting between commands

Hello, Taking my scripting one step farther, I want to run a number of commands one after the other, but the system should wait between commands. How do I do this? Do I use the /wait command, or is it a function wait()? rsync command /wait tar command /wait move to a new folder /wait... (1 Reply)
Discussion started by: patwa
1 Replies

8. Shell Programming and Scripting

Looping and waiting

Hi Is it possible to have a script run in a loop (waiting for a change of state in the network interface), and if the loop continues for five minutes, to have it email the admin, and carry on in the loop? Here is my loop: #!/bin/bash STATE=`echo "show... (3 Replies)
Discussion started by: mikie
3 Replies

9. Shell Programming and Scripting

need to read a file and keep waiting till it satisfies some condition

In my script i am writing to a counter file the no of processes i had started, that is each time i start a process, i will increment the content of counter file and also when the process ends i will decrement the content of the file. after this i do some other activities, by now i want to... (1 Reply)
Discussion started by: senthilk615
1 Replies

10. Linux

waiting process

how to know the information of the waiting process how to calculate the time of the process that it has taken to execute i want to make a program that Should be able to keep a log of the processes expired(The log should contain the starting time, expiry time, time slices used, total execution... (2 Replies)
Discussion started by: shukla_chanchal
2 Replies
Login or Register to Ask a Question