Sponsored Content
Top Forums UNIX for Dummies Questions & Answers if then else logic with while loop problem Post 302500817 by Param0073 on Tuesday 1st of March 2011 03:43:06 PM
Old 03-01-2011
Hi Thanks for the reply.
In my while loop i am checking for the existance of the file (like $AMPS_COMPLETE01 etc ) and also the [$PMON_COUNT -eq 0 ].if any of the condition is not met then i do the wait or the error raising.
Now if $CONV_FLAG is passed as 'J' then how to compair all the file in both are (i.e $DATA and $CONV)Smilie
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with if logic

Hi there, In my shell program I have two if statements the first one checks that the date in yyyymm format is equal to a date from the parameter file in yyyymm format, and that the file and sends an appropiate email The second one checks that the date in yyyymm format is equal to a... (1 Reply)
Discussion started by: rjsha1
1 Replies

2. Shell Programming and Scripting

While Loop Logic

I would need to with making while loop logic working in shell program when I am new into the shell programing 1) I would need to try to get the file from the remote side ----need to try 15 mins apart for 4 times and terminate the program if file is not available.... I would need to know how I... (4 Replies)
Discussion started by: sambakamba
4 Replies

3. Shell Programming and Scripting

for loop logic with multiple parameters

hi, unix wizards, i have a question about the logic of my inner for loop below. first, what i am trying to do is to write a script called create_account that automatically creates mysql accounts. the user can provide a user_name or a group_id as an argument (and the script can take multiple... (1 Reply)
Discussion started by: ankimo
1 Replies

4. Shell Programming and Scripting

loop logic inside of an inline redirect?

i need to log the feedback from the ftp server as i'm performing some deletes. the only way i know of to do this is with the inline redirect << EOF ... but from there to the closing EOF, it's like i'm at the ftp command prompt, so I don't know how to have ksh script logic in there I have an... (3 Replies)
Discussion started by: tlavoie
3 Replies

5. Shell Programming and Scripting

Please help me to figure out the logic for this problem

Hello, i am on 2.6.13-1.1526_FC4smp i have directory named /home , and in there i have directory 2009_10_10 and two files : 2009_10_10.log and 2009_10_11.log How to write shell script which will delete only file/s that don't have his/their 'parent' directory, so in this case , only... (7 Replies)
Discussion started by: tonijel
7 Replies

6. Shell Programming and Scripting

while loop logic

Hi, Here I am trying to query database and check a value, if the value not matches then I wants to re-query the database.Once the value matches, I want to email the reqidstatus_log.txt file. Database query produces a file reqidstatus_log.txt which contains result. But the query not working as... (3 Replies)
Discussion started by: rajsp217
3 Replies

7. Shell Programming and Scripting

Shell/Perl logic for loop

Hi, I have a requirement as follows. Have 3 files. Need to match up the data in each one of them and sum up the data by a field and display it. example given below. File 1 : Name, Emp id File 2 : Empid, Subject, File 3 : Subject, Score, Class Match Emp id in File 1 and File 2 and then... (7 Replies)
Discussion started by: preethgideon
7 Replies

8. Shell Programming and Scripting

Nawk if logic problem

nawk '{ fmt="%3s %22s %48s %35s %21s\n"; if ($3==$6 && $1=="STOPLOSS") { tpy="Successful Match"; jnme=$1; sts="File will be loaded"; cntrl=$3; audit=$6; printf (fmt, tpy,jnme,sts,cntrl,audit) >> "'${AUDIT_DATA_FILE}/${AUDIT36}'" }else if ($3!=$6 && $1=="STOPLOSS") { tpy="Mis-Match ";... (4 Replies)
Discussion started by: wawa
4 Replies
pthread_cond_wait(3T)													     pthread_cond_wait(3T)

NAME
pthread_cond_wait(), pthread_cond_timedwait() - wait or timed wait on a condition variable SYNOPSIS
Parameters cond Pointer to the condition variable to be waited on. mutex Pointer to the mutex associated with the condition variable cond. abstime Absolute time at which the wait expires, even if the condition has not been signaled or broadcast. DESCRIPTION
The function is used to wait for the occurrence of a condition associated with the condition variable cond. The function is used to wait a limited amount of time for the occurrence of a condition associated with the condition variable cond. The abstime parameter specifies the time at which this function should time out. If the absolute time specified by abstime passes and the indicated condition has not been signaled, the function returns an error to the caller. Note: abstime is the time at which the wait expires, not the length of time the thread will wait. The condition variabled denoted by cond must have been dynamically initialized by a call to or statically initialized with the macro Both functions should be called with mutex locked by the calling thread. If mutex is not locked by the calling thread, undefined behavior will result. These functions atomically release mutex and cause the calling thread to block on the condition variable cond. If another thread is able to acquire the mutex after the about-to-block thread has released it but before it has actually blocked, a subsequent call to or by the other thread will behave as if it were issued after the about-to-block thread has blocked. When the condition is signaled or the timed wait expires, the caller is unblocked and will reacquire mutex before returning. Whether these functions succeed or fail, mutex will always be reacquired before returning to the caller. Using different mutexes for concurrent calls to these functions on the same condition variable results in undefined behavior. When using condition variables, there is a predicate associated with the condition wait. If this predicate is false, the thread should perform a condition wait. Spurious wakeups may occur when waiting on a condition variable. A spurious wakeup occurs when a thread returns from a condition wait when it should really continue waiting. A normal signal being delivered to a thread may cause a spurious wakeup dur- ing a condition wait. Since the return values from and do not imply anything about the value of the predicate, the predicate should be re- evaluated. A condition wait is a When the calling thread has deferred cancellation enabled, cancellation requested will be acted upon. If a cancella- tion request is acted upon while a thread is blocked in one of these functions, mutex is reacquired before calling the cancellation cleanup handlers. The cancellation cleanup handlers should release mutex so that application deadlock does not occur. If the condition signal and the cancellation request both occur, the canceled thread will not consume the condition signal (i.e., a different thread will be unblocked due to the condition signal). If a signal is delivered to a thread waiting for a condition variable, upon return from the signal handler, the thread may return zero due to a spurious wakeup or continue waiting for the condition. RETURN VALUE
and return the following values: Successful completion. Failure. An error number is returned to indicate the error. (The variable is not set.) ERRORS
The following error value is returned by if the corresponding condition is detected. abstime has passed and a condition signal has not been received. One of the following error values is returned by and if the corresponding condition is detected. A cond, mutex, or abstime parameter points to an illegal address. The value specified by cond, mutex, or abstime is invalid. mutex is not owned by the calling thread. This error is not returned for a or mutex on HP-UX. Different mutexes are being used for cond. This error is not detected on HP-UX. WARNINGS
It is important to note that when or return without error, the associated predicate may still be false. When returns with the timeout error, the associated predicate may be true. It is recommended that a condition wait be enclosed in the equivalent of a "while loop," which checks the predicate. Undefined behavior results if these functions are called with a mutex. EXAMPLES
is recommended to be used in a loop testing the predicate associated with it. This will take care of any spurious wakeups that may occur. is also recommended to be used in a loop. This function can return success even if the predicate is not true. It should be called in a loop while checking the predicate. If the function times out, the predicate may still have become true. The predicate should be checked before processing the timeout case. The example given below does not do any other error checking. AUTHOR
and were derived from the IEEE POSIX P1003.1c standard. SEE ALSO
pthread_cond_init(3T), pthread_cond_signal(3T). STANDARDS CONFORMANCE
Pthread Library pthread_cond_wait(3T)
All times are GMT -4. The time now is 05:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy