![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Read lines till a blank line is encountered | saurabhsinha23 | UNIX for Dummies Questions & Answers | 1 | 12-19-2007 04:26 PM |
| how to read a file till it encounters a blank line | adityam | UNIX for Dummies Questions & Answers | 1 | 11-26-2007 02:26 AM |
| how to read a file till it encounters a blank line | adityam | Shell Programming and Scripting | 1 | 11-26-2007 02:15 AM |
| how to read a file till it encounters a blank line | adityam | Post Here to Contact Site Administrators and Moderators | 0 | 11-26-2007 01:51 AM |
| Read file based on condition | sbasetty | Shell Programming and Scripting | 5 | 02-01-2007 02:54 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 decide to execute further or wait till the processes i started earlier got over. So i keep reading the counter file for till content becoming zero. I am confused of writing the above part in script please help me writing a loop to keep reading the file till the contents become zero. regards, Senthil |
|
|||||
|
Since you didn't post your OS/version or even the shell you are using OR any of the script - one can only guess that this thread will help.
Specifically: Code:
while [ $(( THREAD_CNT - 1 )) -gt 0 ]
do
update_process_status \
${RUN_ID:-0} \
${P_FN_CD} \
"InProgress" \
"staging ${FILE_TYPE} - sqlldr - threads still running: $(( THREAD_CNT - 1))" \
0
sleep 2
THREAD_CNT=$(ps -p $(print ${PID_LIST} | tr -d ' ' | nawk '{print substr($0,1,length($0)-1)}') | wc -l)
done
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|