I don't really understand what you want to do but there are already some mistakes in your script
But i really don't understand why you want to store the count in a file (except if you want to re-use it in the same or another script). Tell us what you need finally.
The whole thing shorter :
Last edited by frans; 12-14-2009 at 06:08 PM..
Reason: Correction, thanks to Scrutinizer
I am missing something here, I have a file which contains only one line and that is either a number or character string. I am trying to read the file and assign that value to a variable and here it seems I am missing something and not getting the expected results... Here is the code :
#!/bin/ksh... (2 Replies)
HI
I have something like this in a file
ABC = 1
DEF = 2
GHI = 3
JKL = 4
MNO = 5
QRS = 6
TUV = 7
I need to assign ABC to V_abc (that is to a variable)
GHI to V_ghi (that is to another variable)
TUV to say V_tuv
... (6 Replies)
Hi,
I need to place a number located in a text file in a variable so I can perform if/then comparison. How would I go about doing this? Using A=awk '{print $2}' maintenance_date.tmp does not seem to work.
Thanks (1 Reply)
Hi Gurus,
I am new to unix.I have a requirement as below
I have text file like a.txt which contains
a.txt
hi hello
process update
status
Ok to Proceed no issues good
data arrangement
My requirement here is i need to read the file and check for the words
"OK to Proceed" and if... (2 Replies)
I have a txt file
output.txt
Freq = 1900
L = 159I want to assign the values to a variable so that i can further use it in some other script.
like
F=1900
Len=159
etc
i tried doing something with awk but dosent work
F=$(awk 'BEGIN {}/Freq/ {split ($2,a);depth=a};printf "%d\t,... (2 Replies)
I have a file that has four values on each line and I'd like to give each column a variable name and then use those values in each step of a loop. In bash, I believe you could use a while loop to do this or possibly a cat command, but I am super new to programming and I'm having trouble decoding... (2 Replies)
I wrote a simply perl that searched a file for a particualr value and if it found it, rite it and the next three lines to a file. Now I have been asked to check those next three lines for a different value and only write those lines if it finds the second value.
I was thinking the best way to... (1 Reply)
Hi all,
One of my txt file has common format like . And I need to manually assign variable to "/a/b/c/file1/txt" , which has common text before "Calculated summary file:".
I wonder if I can use some command to do that for me, that it read the file and check for that comonn text and assign... (2 Replies)
Hi,
I have a list of files in a directory. Each file has a .txt and a .log extension i.e. file.txt & file.log, file1.txt & file1.log etc. The file with the .log extension may not always exist alongside the file with the .txt extension.
I need to copy the .txt file if there is a corresponding... (6 Replies)
Hi team,
# PERL
I have Dumper variable in perl and containing the below data and trying to fetch value and name from the reference variable.
$VAR1 = {
'retainSysIds' => 'true',
'variables' => ,
'name' => ,
... (4 Replies)
Discussion started by: giridhar276
4 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)