This should work. Note protecting the parentheses in the "if" statement, enclosing strings in double quotes, and using single square brackets. Note spelling "crocodile" the same way in $b !
Hi Guys,
I want to use if conition for my script. Before I used it tried it with some small test scripts. But it was not succeeded. My script and screen output as follows,
Script:
echo 'Do you think Yes or No (y/n) : '
read ans
echo You input anser as $ans
ans1=y
if ( $ans == $ans1... (5 Replies)
hi, :)
pls consider the following if statement
if //g') ]
then
........
else
.......
when i execute the script i am getting the following error
'(' unexpected
I am not able to find the mistake.
could anybody tell where i did mistake.
cheers
RRK (13 Replies)
hi,
actully i need the belp for the below.
host_list=" Host1 host2 host3 host4 "
n=`hostname`
i need to put the condition like the below
if n is among the host mention in the host_list if
then
#some stugg
else
# some other stuff
fi (1 Reply)
Hi ,
I am trying the following simple script . But it is always giving 1 output. Dont know why
#!/bin/sh
find . -name "a.log"
if ; then
echo "1"
else
echo "0"
fi
Kindly advice. it is giving 1 output even when the a.log file is not there (26 Replies)
Hi all,
I have task to delete two different files from all file system. one is core file & other is old file.
i can delete core file but for old file i have to mv in different location.
i wrote a script but it is not working.
i have a two variables in this script first one is delcnt &... (6 Replies)
Hi,
I need to use if condition for search a file pattern on a particular location.
cd $file_Path
if ||
then
do this
else
do that
fi
Can someone help me with the if part, how i can put those conditions?
make sure format should be *.file* and *.file
file is a keyword which i... (5 Replies)
Hi i am writing a script where i am running , 5 scripts together in 1 script .
Now what i want is when these 5 scripts run completely , i should execute some other commands like i have compile the data etc.
I have have 5 echo statements at the end of all those scripts .
Like echo "1 is done" in... (1 Reply)
Hi All,
I am using below if condition to check whether null is passed as a parameter to the program
if or ;
then
echo "ABC">>$FILE
else
echo "CDF">>$FILE
fi
However it is saying me null=null command not found . Please help me with this (9 Replies)
Hi All,
Seeking for your assistance on how to condition it correctly.
cat file1.txt
290,1663,43,888,0,0.00,86.91,0.00,26.98,0.00
290,1663,52,0,0,0.00,0.00,0.00,0.00,0.00
290,1663,52,888,0,0.00,34.60,0.00,9.00,0.00
1st scenario:
if the fourth column contains 888s and 0s it is by... (16 Replies)
Discussion started by: znesotomayor
16 Replies
LEARN ABOUT OSF1
tis_cond_init
tis_cond_init(3) Library Functions Manual tis_cond_init(3)NAME
tis_cond_init - Initializes a condition variable.
LIBRARY
Standard C Library (libc.so, libc.a)
SYNOPSIS
#include <tis.h>
int tis_cond_init(
pthread_cond_t *cond);
STANDARDS
None
PARAMETERS
Address of the condition variable (passed by reference) to be initialized.
DESCRIPTION
This routine initializes a condition variable (cond) with the DECthreads default condition variable attributes.
A condition variable is a synchronization object used in conjunction with a mutex. A mutex controls access to shared data. When threads
are present, a condition variable allows threads to wait for data to enter a defined state.
For more information about actions taken when threads are present, refer to the pthread_cond_init(3) description.
Your program can use the macro PTHREAD_COND_INITIALIZER to initialize statically allocated condition variables to the DECthreads default
condition variable attributes. Static initialization can be used only for a condition variable with storage class extern or static - auto-
matic (stack local) objects must be initialized by calling tis_cond_destroy(3). Use this macro as follows:
pthread_cond_t condition = PTHREAD_COND_INITIALIZER
When statically initialized, a condition variable should not also be initialized using tis_cond_init(3).
RETURN VALUES
If an error condition occurs, the following occurs: The routine returns an integer value indicating the type of error. The condition vari-
able is not initialized. The contents of condition variable cond are undefined.
The possible return values are as follows: Successful completion. The system lacks the necessary resources to initialize another condition
variable, or The system-imposed limit on the total number of condition variables under execution by a single user is exceeded. The imple-
mentation has detected an attempt to reinitialize the object referenced by cond, a previously initialized, but not yet destroyed condition
variable. The value specified by attr is not a valid condition variable. Insufficient memory exists to initialize the condition variable.
ERRORS
None
RELATED INFORMATION
Functions: tis_cond_broadcast(3), tis_cond_destroy(3), tis_cond_signal(3), tis_cond_wait(3)
Manuals: Guide to DECthreads and Programmer's Guide
delim off
tis_cond_init(3)