Hello,
Can you explain why in the first 2 commands the awk does not print anything? Is it looking of a specific format ?
Thanks.
$ echo 12a3 | awk '($1>=2) {print $1}' # prints nothing
$ echo 123a | awk '($1>=2) {print $1}' # prints nothing
$ echo a123 | awk '($1>=2) {print $1}'
a123... (1 Reply)
I do not know how to do this unless I use a bunch of if statements. I need a script to replace numbers in each record in a file. I am really getting tangled in this web.
If a fieldA (19 positions) is greater than 14 digits, I have to change the data (resulting fieldA is fixed 19 postions).
If... (5 Replies)
Hi there,
I wanna define a variable 'tempbase'. Therefore I read a text file "base.out". "base.out" contains a list with four columns. 'tempbase' is the 4th entry in the line, where the first entry is equal to the predefined variable $orb1 and the second entry is equal to $orb2. I wrote the code... (2 Replies)
Hi there, here is my command
ssh host.local "/path/to/my/perscript/hostconfig.pl -s $HOST -d |awk '{if (\$4 > 120)print \"My error message\";exit}{s=0; for (i=1; i<=NF; i++) s++; if(s == 13) print \$3}'"
The problem is if conditional 1 is met (i.e $4 > 120), i don't see "My error message", the... (5 Replies)
Hi All,
I have a file with below contents.
"en2"/10.185.81.0:cluster_interconnect,"en5"/10.185.81.0:cluster_interconnect,"en6"/169.181.146.0:public
I want to take the interface name from the file and convert it as ipaddress using ifconfig command get the output like below
en6 ->... (2 Replies)
I'm having a problem pulling UID's from data. The data outputs a user's UID in one of three ways:
1. Error User user_name already assigned with <UID>
2. Success <UID> reserved for user_name
3. <a load of crap because there was a db failure yet somehow the UID is still in there>
I typically... (5 Replies)
Hello Friends,
I need to find some CDRs in production servers whose 1st field value and 2nd field value = 1 and 11th looks like 45.123... where there are more than 3 digits after comma.so i wrote a one liner, something like below but does not work, however when i used first and second conditions... (8 Replies)
hello gurus,
I want to use an associative array from a file to populate a field of another file, by matching several columns in order of priority. If the first column matches, then i dont want to match $2. Similarly I only want to match $3 when $1 and $2 are not in associative array.
For the... (6 Replies)
Discussion started by: ritakadm
6 Replies
LEARN ABOUT HPUX
pthread_cond_destroy
pthread_cond_init(3T)pthread_cond_init(3T)NAME
pthread_cond_init(), pthread_cond_destroy() - initialize or destroy a condition variable
SYNOPSIS PARAMETERS
cond Pointer to the condition variable to be initialized or destroyed.
attr Pointer to the attributes object that defines the characteristics of the condition variable to be initialized. If the
pointer is NULL, default attributes are used.
DESCRIPTION
The function initializes the condition variable cond with the attributes attr. If attr is NULL, the default condition variable attributes
are used to initialize the attributes object. See pthread_condattr_init(3T) for a list of the default condition variable attributes.
After successful initialization, the condition variable may be used in condition variable operations. A condition variable should be ini-
tialized only once or the resulting behavior is undefined. The function provides a way to ensure that a condition variable is only ini-
tialized once.
The macro can be used to initialize condition variables that are statically allocated. These condition variables will be initialized with
default attributes. The function does not need to be called for statically initialized condition variables.
If the process-shared attribute in the condition variable attributes object referenced by attr is defined as the condition variable must be
allocated such that the processes sharing the condition variable have access to it. This may be done through the memory-mapping functions
(see mmap(2)) or the shared memory functions (see shmget(2)).
destroys the condition variable cond. This function may set cond to an invalid value. The destroyed condition variable can be reinitial-
ized using the function If the condition variable is used after destruction in any condition variable call, the resulting behavior is unde-
fined.
A condition variable should be destroyed only when there are no threads currently blocked on it. Destroying a condition variable that is
currently in use results in undefined behavior.
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:
The system does not have the available resources (other than memory)
to initialize the condition variable.
The specified condition variable is an already initialized condition
variable. However, getting for reinitializing the condition variable cannot be expected all the time since the
behavior of reinitializing the condition variable is undefined.
The cond parameter points to an illegal address.
The value specified by
cond or attr is invalid.
There is insufficient memory available in which to initialize
the condition variable.
If any of the following occur, the function returns the corresponding error number:
An attempt to destroy
cond while it is in use by another thread.
cond is not a valid condition variable.
WARNINGS
The space for condition variable must be allocated before calling Undefined behavior will result if the process-shared attribute of attr is
and the space allocated for the condition variable is not accessible to cooperating threads.
AUTHOR
and were derived from the IEEE POSIX P1003.1c standard.
SEE ALSO pthread_cond_signal(3T), pthread_cond_wait(3T).
STANDARDS CONFORMANCE
Pthread Library pthread_cond_init(3T)