Before I even attempt this, is it possible to grep for a pattern, maybe a partial sentence like "go to page 3", assign that to a variable and then use awk or something to pull out the 3 and assign it to a variable? So first I would have
Gotopg = "go to page 3"
then
page = 3 (9 Replies)
I am trying to write a simple script which will take a variable with sed to take a line out of a text and display it
#!/bin/sh
exec 3<list
while read list<&3
do
echo $list
sed -n '$list p'<list2
done
this does not work, yet when I replace the $list variable from the sed command and... (1 Reply)
Hi,
Is there any way to assign defaults values to the shell variables without reassigning them ( restarting the session)
for example
after login the value of ORACLE_HOME=/a/b/c
i have changed this value from the console
export ORACLE_HOME=/c/d
now what if i want the value exported to... (1 Reply)
Hi GUYS,
I have function. I am assigning a line count to count variable. But it is throwing an error at this line.
function_recur (){
#file being created in this function
lenth = `wc -l function_outpu.dat`;
echo $lenth;
}
this is the error i got
rec.ksh: lenth: not found.
... (3 Replies)
Hi,
I am having a line which is separated by -
I need to extract each field and put into some variable.
a=`echo "this-is-the-case" | awk -F- '{print $1}' `
b=`echo "this-is-the-case" | awk -F- '{print $2}' `
c=`echo "this-is-the-case" | awk -F- '{print $3}' `
d=`echo "this-is-the-case" | awk... (2 Replies)
Hi all,
I want write a script to display 5rows at times from a input file.
my out like:
echo " display started"
r1
r2
r3
r4
r5
... Some action items...
again i need next 5 lines.
can you please advise. (2 Replies)
Hi Gurus,
I have a file named log with 2 lines
Each line is a file name. eg
$ cat log
monday
tuesday
I need to read log and assign each output(filename) to a different variable.
The following doesn't work:-
while read A B
do
echo " a is ${A} "
echo " b is ${B} "
done <... (6 Replies)
HELLO!!
I'm trying to pass a variable with in the 'sed' command (which would add some piece of code to file at a particular line). We can use
sed '{line-number}a\
alfjaljf\
aslfjsfsjafl\
adlfjaf\' file.txt
If file.txt is
Now, I would like to add the parameter 'lmn' after... (1 Reply)
i have variables RECIPIENTS_DEVL,RECIPIENTS_UACC,RECIPIENTS_PROD
i have a case statement to get the phase variable:
case ${WMD_UPHASE1} in
u) WMD_UPHASE4=UACC;;
i) WMD_UPHASE4=DEVL;;
p) WMD_UPHASE4=PROD;;
d) WMD_UPHASE4=DEVL;;
*) WMD_UPHASE4=DEVL;;
esac
I am unable to... (3 Replies)
Hi,
Can the below be clarified please. i just want to know what is the difference between the two ways of assigning variables as mentioned below.
export SRC_TBL=${SRC_TBL-"MMA_COPAY_PLN_FACT_STG"}
export SRC_TBL="MMA_COPAY_PLN_FACT_STG"
thanks in advance :)
Arun (1 Reply)
Discussion started by: Arun Mishra
1 Replies
LEARN ABOUT ULTRIX
shmat
shmop(2) System Calls Manual shmop(2)Name
shmop, shmat, shmdt - shared memory operations
Syntax
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
char *shmat (shmid, shmaddr, shmflg)
int shmid;
char *shmaddr;
int shmflg;
int shmdt (shmaddr)
char *shmaddr;
Description
The system call attaches the shared memory segment associated with the shared memory identifier specified by shmid to the data segment of
the calling process. The segment is attached at the address specified by one of the following criteria:
If shmaddr is equal to zero, the segment is attached at the first available address as selected by the system.
If shmaddr is not equal to zero and (shmflg & SHM_RND ) is true, the segment is attached at the address given by (shmaddr- (shmaddr modulus
SHMLBA )).
If shmaddr is not equal to zero and (shmflg & SHM_RND ) is false, the segment is attached at the address given by shmaddr.
The segment is attached for reading if (shmflg & SHM_RDONLY ) is true. Otherwise, it is attached for reading and writing.
The system call detaches from the calling process's data segment the shared memory segment located at the address specified by shmaddr.
Return Values
Upon successful completion, the return values are as follows:
o The system call returns the data segment start address of the attached shared memory segment.
o The system call returns a value of zero (0).
Otherwise, a value of -1 is returned, and errno is set to indicate the error.
Diagnostics
The system call fails and not attach the shared memory segment, if any of the following is true:
[EINVAL] The shmid is not a valid shared memory identifier.
[EACCES] Operation permission is denied to the calling process. For further information, see
[ENOMEM] The available data space is not large enough to accommodate the shared memory segment.
[EINVAL] The shmaddr is not equal to zero, and the value of (shmaddr- (shmaddr modulus SHMLBA )) is an illegal address.
[EINVAL] The shmaddr is not equal to zero, (shmflg & SHM_RND ) is false, and the value of shmaddr is an illegal address.
[EMFILE] The number of shared memory segments attached to the calling process would exceed the system imposed limit.
The fails and does not detach the shared memory segment if:
[EINVAL] The shmaddr is not the data segment start address of a shared memory segment.
See Alsoexecve(2), exit(2), fork(2), shmctl(2), shmget(2)shmop(2)