i have this assignment.. and i mad this script but there is something wrong with it.. if anyone can tell me.. watz going on... i would appreciate it.. tHnX in advance..
ThnX again
Hi all,
Can somebody answer the following query
Thanks,
Srinivas
A shell program that takes one or any number of file directory names as input; sorts the directories given as parameters jointly in the ascending or decending order of choice For EX : dips abc etc desc will sort the files... (2 Replies)
Hello,
I'm throwing this out there as a novice to the Unix world...I've
been working on a project that requires me to ouput (using the echo command) a list of names in a single column format, but the problem is the input is in row format followed by a blank space...If anyone could give me a... (2 Replies)
Hi,
I'm a newbie to UNIX scripting and I'm having some trouble compiling my script. I'm using the Bourne Shell and cannot seem to use the substr function correctly. I'm trying to extract the last two digits of a year that's stored in a variable based off of a condition. I've searched the... (4 Replies)
Dear Bourne Shell Expert,
I am trying to change the current working directory from within a Bourne Shell script. Simply enough i thought !
As I am sure you are well aware, Inside the script i echo `pwd` and it seems ok, but the shell spawns another shell to execute this and as such, when my... (10 Replies)
Bourne: How to invoke an alias from within a shell script
If I type in the alias in the command line, it runs
If I insert that same alias into my shell script and run the shell script, the alias is not invoked.
Help please. (2 Replies)
Hello all, I'm new to shell scripting and want to make a script that I can write to log the users logging on and off the a unix system.
I have had a good look over the past few days to crack it, I think I am getting close.
I want a script that runs an infinite loop to check every 5 seconds... (14 Replies)
Attempting to write a script to eventually notify me via email for when there is packetloss across the backbone. I am looking for values greater than 0% in the mtr field.
#!/bin/sh
target=www.google.com
date +"%D"_"%T" >> /home/rich/mtr.log
echo "----------------------------------------" >>... (1 Reply)
Hi,
Get the following error when running a shell script with following statement.
Syntax error
at line 150 : `(' is not expected
150: declare -a VPO_SEV=(Normal Warning Minor Major Critical)
it runs fine using bash, so I guess the script should be using bash but is there a... (1 Reply)
I am suppose to make a program that cuts the extension off of a file. It uses that .ext to decide which program needs to be used to open the file. This only finds the name of the program from a list of programs I made. My problem is when it has the name of the program it needs to use, how can I... (3 Replies)
This is my question, below the question is the template
Write and execute a Bourne shell script called homework that will
From within the script, create three background processes:
a) (2 points) one that saves a long listing of your hidden files to a file named hiddenlist
b) (2 points) ... (4 Replies)
Discussion started by: luislozoya
4 Replies
LEARN ABOUT OPENSOLARIS
_lwp_sema_wait
_lwp_sema_wait(2) System Calls _lwp_sema_wait(2)NAME
_lwp_sema_wait, _lwp_sema_trywait, _lwp_sema_init, _lwp_sema_post - semaphore operations
SYNOPSIS
#include <sys/lwp.h>
int _lwp_sema_wait(lwp_sema_t *sema);
int _lwp_sema_trywait(lwp_sema_t *sema);
int _lwp_sema_init(lwp_sema_t *sema, int count);
int _lwp_sema_post(lwp_sema_t *sema);
DESCRIPTION
Conceptually, a semaphore is an non-negative integer count that is atomically incremented and decremented. Typically this represents the
number of resources available. The _lwp_sema_init() function initializes the count, _lwp_sema_post() atomically increments the count, and
_lwp_sema_wait() waits for the count to become greater than 0 and then atomically decrements it.
LWP semaphores must be initialized before use. The _lwp_sema_init() function initializes the count associated with the LWP semaphore
pointed to by sema to count.
The _lwp_sema_wait() function blocks the calling LWP until the semaphore count becomes greater than 0 and then atomically decrements it.
The _lwp_sema_trywait() function atomically decrements the count if it is greater than zero. Otherwise it returns an error.
The _lwp_sema_post() function atomically increments the semaphore count. If there are any LWPs blocked on the semaphore, one is unblocked.
RETURN VALUES
Upon successful completion, 0 is returned. A non-zero value indicates an error.
ERRORS
The _lwp_sema_init(), _lwp_sema_trywait(), _lwp_sema_wait(), and _lwp_sema_post() functions will fail if:
EINVAL The sema argument points to an invalid semaphore.
EFAULT The sema argument points to an illegal address.
The _lwp_sema_wait() function will fail if:
EINTR The function execution was interrupted by a signal or fork(2).
The _lwp_sema_trywait() function will fail if:
EBUSY The function was called on a semaphore with a zero count.
The _lwp_sema_post() function will fail if:
EOVERFLOW The value of the sema argument exceeds SEM_VALUE_MAX.
SEE ALSO fork(2)SunOS 5.11 8 May 1998 _lwp_sema_wait(2)