Hi guys, I hope you can help me with my problem.
I have a text file that contains lines like this:
78 ANGELO -809.05
79 ANGELO2 -5,000.06
I need to find all occurences of amounts that are negative and replace them with x's
78 ANGELO xxxxxxx
79... (4 Replies)
for a certain directory, I want to grep a particular file called ABCD so what I do is
ls /my/dir | grep -i "ABCD" | awk '{print $9}'
however, there is also this file called ABCDEFG, the above command would reurn both file when I only want ABCD, please help! (3 Replies)
Hello,
i have a program where i have to get a character from the user and check it against the word i have and then replace the character in a blank at the same position it is in the word. (7 Replies)
Hi all,
I appreciate the enormous amount of knowledge that flows in this forum.
I am an average UNIX user. I have many files with lines like the below. I have separated each line with space for ease of reading. I need to replace the first occurance of "/00" with null on those lines that have... (6 Replies)
I've been battling with parsing a comma-delimited string, and have had what I would call B- success. I'm using perl and trying to parse out specific identifiers from a string, into a new string. When things are "normal," my regex works fine. When things get complicated, my script fails... (1 Reply)
I have a string like ab or abc of whatever length. But i want to know whether another string ( for example, abcfghijkl, OR a<space> bcfghijkl ab<space> cfghijkl OR a<space>bcfghijkl OR ab<space> c<space> fghijkl ) starts with ab or abc... space might existing on the longer string... If so, i... (4 Replies)
Hi,
i want to know how to compare string of file with input string
im trying following code:
file_no=`paste -s -d "||||\n" a.txt | cut -c 1`
#it will return collection number from file
echo "enter number"
read " curr_no"
if ; then
echo " current number already present"
fi
... (4 Replies)
I am facing a problem and I would be grateful if you can help me :wall:
I have a list of words like
And I have a datafile like
the box of
the box of tissues out of
of tissues out of
the book, the
the book, the pen and the
the pen and the
I want to find Patterns of “x.*x” where... (2 Replies)
Hi, I need to search/grep userid and its value based on a condition that the user id is under the heading "*central_test*" in a big file of about 70808MB. The * represents some strings before and after the string "centrla_test". Could anyone please guide. OS is hp-ux. (2 Replies)
Discussion started by: sam_bd
2 Replies
LEARN ABOUT SUNOS
semget
semget(2) System Calls semget(2)NAME
semget - get set of semaphores
SYNOPSIS
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
int semget(key_t key, int nsems, int semflg);
DESCRIPTION
The semget() function returns the semaphore identifier associated with key.
A semaphore identifier and associated data structure and set containing nsems semaphores (see intro(2)) are created for key if one of the
following is true:
o key is equal to IPC_PRIVATE.
o key does not already have a semaphore identifier associated with it, and (semflg&IPC_CREAT) is true.
On creation, the data structure associated with the new semaphore identifier is initialized as follows:
o sem_perm.cuid, sem_perm.uid, sem_perm.cgid, and sem_perm.gid are set equal to the effective user ID and effective group ID, respec-
tively, of the calling process.
o The access permission bits of sem_perm.mode are set equal to the access permission bits of semflg.
o sem_nsems is set equal to the value of nsems.
o sem_otime is set equal to 0 and sem_ctime is set equal to the current time.
RETURN VALUES
Upon successful completion, a non-negative integer representing a semaphore identifier is returned. Otherwise, -1 is returned and errno is
set to indicate the error.
ERRORS
The semget() function will fail if:
EACCES A semaphore identifier exists for key, but operation permission (see intro(2)) as specified by the low-order 9 bits of sem-
flg would not be granted.
EEXIST A semaphore identifier exists for key but both (semflg&IPC_CREAT) and (semflg&IPC_EXCL) are both true.
EINVAL The nsems argument is either less than or equal to 0 or greater than the system-imposed limit. See NOTES.
A semaphore identifier exists for key, but the number of semaphores in the set associated with it is less than nsems and
nsems is not equal to 0.
ENOENT A semaphore identifier does not exist for key and (semflg&IPC_CREAT) is false.
ENOSPC A semaphore identifier is to be created but the system-imposed limit on the maximum number of allowed semaphores or sema-
phore identifiers system-wide would be exceeded. See NOTES.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO ipcrm(1), ipcs(1), rctladm(1M), intro(2), semctl(2), semop(2), setrctl(2), ftok(3C), attributes(5), standards(5)NOTES
The system-imposed limit on the value of the nsems argument is the maintained on a per-process basis using the process.max-sem-nsems
resource control.
The system-imposed limit on the number of semaphore identifiers is maintained on a per-project basis using the project.max-sem-ids resource
control.
See rctladm(1M) and setrctl(2) for information about using resource controls.
SunOS 5.10 11 Feb 2003 semget(2)