Sponsored Content
Top Forums UNIX for Dummies Questions & Answers if...elif...fi condition in Unix Post 27502 by peter.herlihy on Monday 2nd of September 2002 11:53:59 PM
Old 09-03-2002
You should use the 'gt' function...(greater than)...or 'lt' less than.

elif [ $int1 -gt $int2 ]
then echo "int one is greater than..........
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

If and Or Condition in Unix [ksh]

I have the code below. I want to said If TrackErrors > 0 or count == 0 then MailErrors else MailSuccess fi. if then MailErrors ${count} else MailSuccess ${count} fi Any helps greatly appreciated. (2 Replies)
Discussion started by: leemjesse
2 Replies

2. Shell Programming and Scripting

If..elif..else...fi

Hi all, I got some problems on executing the following scripts. Scripts: if ]; then echo "M${str}O 0 1" >> ${tempFile} elif ]; then echo "M${str}O 1 0" >> ${tempFile} else echo "M${str}O 0 0" >> ${tempFile} fi Error: "`;' is not expected." what's the problem? (2 Replies)
Discussion started by: Rock
2 Replies

3. Shell Programming and Scripting

Unix and db2 where condition issue(new line)

Hi I am extracting a column value(DESCRIPTION) from one table and passing it to another db2 statement in a shell code to fetch some value(ID) but the value when passed in where condition is taking as newline+value. Please find the out put when executed: + echo description is ::::... (1 Reply)
Discussion started by: msp2244
1 Replies

4. Shell Programming and Scripting

if condition to check the hostname (unix)

I want to know the if condition in checking the hostname in unix and then running a cron job (all in a single line) Thanks (2 Replies)
Discussion started by: prash358
2 Replies

5. Shell Programming and Scripting

how to use split command in unix shell with a condition

Hi all, I have a file which I want to split into several files based on a condition. This files has several records. I want one record per file. Each record ends with a //. So, I want to separate files based on this condition. I want split files to be named with the name across the field ID (for... (2 Replies)
Discussion started by: kaav06
2 Replies

6. Shell Programming and Scripting

Condition checking in UNIX

i have a script where i have to find the age of a file, if then echo "dnb file is present for the monthly load" >> $RUNLOG dnb="1" else echo "dnb file has not arrived yet" > $ERRLOG dnb="0" fi i know the file is available so... (3 Replies)
Discussion started by: lovelysethii
3 Replies

7. Shell Programming and Scripting

Checking for null condition in a UNIX variable

i have this code for i in `cat sql_output.txt` do -- some script commands done sql_output.txt has 1 column with employee_ids If the sql_output.txt is null then the do loop should not execute. How can i implement this. for i in `cat sql_output.txt` If i is null or empty then ... (5 Replies)
Discussion started by: rafa_fed2
5 Replies

8. Shell Programming and Scripting

If Condition Issue in UNIX

Hi I am trying to do a "IF" Condition in UNIX where we compare EACH file size in a directory with a SIZE (Parameter passed) If Each File size EXCEEDS parameter passed SIZE then we manipulate the file. Somehow the IF condition do not work ?? (is this Variable decalration issue ??) ... (9 Replies)
Discussion started by: Pete.kriya
9 Replies

9. UNIX for Advanced & Expert Users

How to create folder by using if and elif condition?

Hi All, I have already code to create folder for one country let say US , now we want to create folder/directory for JP country also using shell script , application server. $COUNTRY='US' if ] then if mkdir -m 777 -p /opt/TEST/$COUNTRY/$INVOICE >/dev/null 2>&1 | tee -a ... (5 Replies)
Discussion started by: Boost
5 Replies

10. Shell Programming and Scripting

Issue with condition "if then elif else fi"

Hi everybody, I must get trought a shell script 3 arguments. 1st argument = $1 (can take values REP1..4) 2nd argument = $2 (can take values A..Z) 3rd arguement = $3 (also can take values A...Z) I've written this code : #!/bin/bash if then liste=/data/folder1 echo... (6 Replies)
Discussion started by: shellX
6 Replies
pthread_condattr_init(3T)												 pthread_condattr_init(3T)

NAME
pthread_condattr_init(), pthread_condattr_destroy() - initialize or destroy a condition variable attributes object. SYNOPSIS
PARAMETERS
attr Pointer to the condition variable attributes object to be initialized or destroyed. DESCRIPTION
initializes the condition variable attributes object attr with the default values for all attributes. The attributes object describes a condition variable in detail and is passed to the condition variable initialization function. When a condition variable attributes object is used to initialize a condition variable, the values of the individual attributes determine the characteristics of the new condition variable. Attributes objects act like additional parameters to object initialization. A single attributes object can be used in multiple calls to the function When a condition variable is initialized with an attributes object, the attributes are, in effect, copied into the condition variable. Consequently, any change to the attributes object will not affect any previously initialized condition variables. Once all condition vari- ables needing a specific attributes object have been initialized, the attributes object is no longer needed. The condition variable attributes and their default values are: The default value is If an initialized condition variable attributes object is reinitialized, undefined behavior results. destroys the condition variable attributes object attr. The destroyed condition variable attributes object ceases to exist and its resources are reclaimed. Using attr after it has been destroyed results in undefined behavior. A destroyed condition variable attributes object can be reinitialized using the function Condition variables that have been already initialized using this attributes object are not affected by the destruction of the condition variable attributes object. RETURN VALUE
Upon successful completion, and return zero. Otherwise, an error number is returned to indicate the error (the variable is not set). ERRORS
If any of the following occur, the function returns the corresponding error number: [ENOMEM] There is insufficient memory available in which to initialize the condition variable attributes object. [EINVAL] attr is not a valid condition variable attributes object. For each of the following conditions, if the condition is detected, the function returns the corresponding error number: [EINVAL] attr is not a valid condition variable attributes object. AUTHOR
and were derived from the IEEE POSIX P1003.1c standard. SEE ALSO
pthread_create(3T), pthread_condattr_getpshared(3T), pthread_cond_init(3T). STANDARDS CONFORMANCE
Pthread Library pthread_condattr_init(3T)
All times are GMT -4. The time now is 11:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy