10-24-2005
how do u assign the values to different variables when it is presneted in one line??
hey people..
i have a configuration file that looks like
7080 7988
net04.xxxxx.edu
20
where 20 is the number of threads in the thread pool initially.
net04.xxxxx.edu is the hostname.
and 7080 7988
are two ports. first one for client requests and second one for dns communication. now my problem is,
how will i split these two?
if i read line, it will read both values..
do i read them as two separate arguments?
do i check for a space in between and then take them up respectively?
are there suggestions ?? lemme know pls.
bye bye
Last edited by SwetaShah; 10-24-2005 at 01:48 PM..
Reason: wrong title.. sorry!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How do I assign values to variables made in a script?
e.g.
for ((x=0;x<=5;i+=1)); do
Xm$i=$var
done (0 Replies)
Discussion started by: gelitini
0 Replies
2. Shell Programming and Scripting
Hello,
I have a cat.dat file, i would like shell to read each 3 lines and set this 3 lines to 3 different variables.
my cat.dat is:
11
12
+380486461001
12
13
+380486461002
13
14
+380486461003
i want shell to make a loop and assign 1st line to student_id, 2nd line to... (4 Replies)
Discussion started by: rosalinda
4 Replies
3. Shell Programming and Scripting
The text file has one single row and looks like this
Q1 P1 2006
I have to pick up this values from a shell script into three different variables,
say quarter, period and year from the above text file. Some one know's how to do this? I went through 'sed', dint really know how to... (3 Replies)
Discussion started by: sarsani
3 Replies
4. Shell Programming and Scripting
Hi,
I have a file like the following...
CUST=
DIR=
NULIST=
name=philps_123
How can i add values to each of these unassigned variables using a shell script?
say for eg: i have values for CUST as onida, dir as /dir/onida, NULIST as /tmp/onida_files. How can i add these values to... (11 Replies)
Discussion started by: Tuxidow
11 Replies
5. Shell Programming and Scripting
For example, I have a file with below lines containing VOB tags and VOB paths.
* /vobs/fts/FTSUSM20_VOB /ccvobsslx01/projects/vobs/eml/FTSUSM20_VOB
* /vobs/fts/FTS20_VOB /ccvobsslx01/projects/vobs/eml/FTS20_VOB
* /vobs/pmv/PMS_VOB /ccvobsslx01/projects/vobs/cpm/_/PMS_VOB
*... (4 Replies)
Discussion started by: senthilkc
4 Replies
6. Shell Programming and Scripting
Hi,
I have requirement to assign values to variables which are created dynamically.
Below is the code which i am using to achieve above requirement.
#!/bin/ksh
oIFS="$IFS"; IFS=','
STR_FAIL_PARENT_IF_FAILS="WF_F_P_IF_FAILS1,WF_F_P_IF_FAILS2,WF_F_P_IF_FAILS3"
set -A... (1 Reply)
Discussion started by: tmalik79
1 Replies
7. Shell Programming and Scripting
I am trying to read a input file which has two columns separated by space
Input file
server1 server2
server3 server4
server5 server6
When i execute the below while code it reads line by line and a and b variables are able to successfully fetch the values
while read a b
do
echo "$a"
echo... (5 Replies)
Discussion started by: chidori
5 Replies
8. Shell Programming and Scripting
I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables.
I need to read this file which is an input to my script
Config.txt
file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies
9. Shell Programming and Scripting
so i've been used to doing it this way:
SVAL=$(echo "7 3 2 38 3" | awk '{print $2}')
4VAL=$(echo "4:21:N:3" | awk -F":" '{print $4}')
I know there's a way to do it by putting the value in an array and assigning it that way. but i'm not sure how to do it efficiently. any ideas? i dont... (9 Replies)
Discussion started by: SkySmart
9 Replies
10. Shell Programming and Scripting
i have a program that spits out a certain number of values. i dont know the number of values. they can be 4, 10, 7, 20, no idea.
but, i want to be able to assign each of the value returned by this program to a variable.
in the latest instance, the program gave the following 6 values:
4... (8 Replies)
Discussion started by: SkySmart
8 Replies
LEARN ABOUT OSF1
pthread_rwlock_unlock
pthread_rwlock_unlock(3) Library Functions Manual pthread_rwlock_unlock(3)
NAME
pthread_rwlock_unlock - Unlock a read-write lock.
LIBRARY
DECthreads POSIX 1003.1c Library (libpthread.so)
SYNOPSIS
#include <pthread.h>
int pthread_rwlock_unlock(
pthread_rwlock_t *rwlock);
PARAMETERS
Address of the read-write lock to be unlocked.
DESCRIPTION
This routine releases a lock acquisition held on the read-write lock object referenced by rwlock. Results are undefined if rwlock is not
held by the calling thread.
If this routine is called to release a lock for read access on rwlock and the calling thread also currently holds other locks for read
access on rwlock, the read-write lock object remains in the read locked state. If this routine releases the calling thread's last lock for
read access on rwlock, the calling thread is not longer one of the owners of the lock object.
If this routine is called to release a lock for write access on rwlock, the lock object is put in the unlocked state with no owners.
If a call to this routine results in the read-write lock object becoming unlocked and there are multiple thread waiting to acquire that
lock for write access, DECthreads uses the scheduling policy of those waiting threads to determine which thread next acquires the lock
object for write access. If there are multiple thread waiting to acquire the read-write lock object for read access, DECthreads uses the
scheduling policy of those waiting threads to determine the order in which those threads acquire the lock for read access. If there are
multiple threads waiting to acquire the read-write lock object for both read and write access, it is unspecified whether a thread waiting
for read access or for write access next acquires the lock object.
If the read-write lock object referenced by rwlock is not initialized, the results of calling this routine are undefined.
RETURN VALUES
If an error condition occurs, this routine returns an integer value indicating the type of error. Possible return values are as follows:
Successful completion. The values specified by rwlock does not refer to an initialized read-write lock object. The current thread does
not hold the read-write lock object.
ERRORS
None
RELATED INFORMATION
Functions: pthread_rwlock_init(3), pthread_rwlock_rdlock(3), pthread_rwlock_wrlock(3), pthread_rwlockattr_init(3)
Manuals: Guide to DECthreads and Programmer's Guide
delim off
pthread_rwlock_unlock(3)