06-04-2015
It is a matter of logic. Until the number of parameters is not equal to 0. If the number of parameters is 2 then it will not enter the loop, since the condition is satisfied ( 2 is unequal to 0 ).
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
cat .servers | while read LINE; do
ssh jason@$LINE $1
done
exit 1
./command.ksh "ls -l ~jason"
Why does this ONLY iterate on the first server in the list? It's not doing the command on all the servers in the list, what am I missing?
Thanks!
JP (2 Replies)
Discussion started by: jpeery
2 Replies
2. UNIX for Dummies Questions & Answers
Howdie everyone...
I have a shell script RemoveFiles.sh
Inside this file, it only has two commands as below:
rm -f ../../reportToday/temp/*
rm -f ../../report/*
My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies
3. Shell Programming and Scripting
Hello, the ls -d command to only list directories in a directory doesn't seem to work on Solaris and the man command says to use that combination: ls -d
Anyone have the same problem and find a resolve?
Thanks
BobK (9 Replies)
Discussion started by: bobk544
9 Replies
4. UNIX for Dummies Questions & Answers
why lp -o <option> doesn't work on my SCO Unix. (4 Replies)
Discussion started by: wendyz
4 Replies
5. Shell Programming and Scripting
Hi. I've been playing around a bit. This isn't for any practical purpose-- it's really just a theoretical exercise. I wrote this little thing:
foreach num ( 6 5 4 )
awk -v "number=$num" 'BEGIN{for(x=0;x<$number;x++) printf "-"; printf "\n"}'
end
I would expect the following output:
... (3 Replies)
Discussion started by: treesloth
3 Replies
6. Shell Programming and Scripting
Hi
I have put alias ll='ls -la' in .profile file but it doesn't work.
On hand it works it looks like the .profile file is not beeing read.
How to check whitch file is loaded? ,profile? .bash_profile?
My system: SunOS mion 5.10 Generic
Shell: /bin/pfksh
Thanks (2 Replies)
Discussion started by: miojamo
2 Replies
7. Shell Programming and Scripting
i want to get the value for column 4rth when i =4. please guide what i am doing wrong. thanks
var=`cat file.csv`
for i in $var; do {
if ; then
var4=$var4+$i
fi
echo $i
}
done
I am geting this error message "0403-009 The specified number is not valid for this command." (8 Replies)
Discussion started by: sagii
8 Replies
8. UNIX for Dummies Questions & Answers
find . -name "05_scripts" -type d -exec mv -f {}/'*.aep\ Logs' {}/.LogFiles \;
Returns this failure:
mv: rename ./019_0120_WS_WH_gate_insideTEST/05_scripts/*.aep\ Logs to ./019_0120_WS_WH_gate_insideTEST/05_scripts/.LogFiles/*.aep\ Logs: No such file or directory
I don't know why it's trying... (4 Replies)
Discussion started by: scribling
4 Replies
9. HP-UX
I edited sudoers like this:vi /etc/sudoers
subex ALL =(root) NOPASSWD: /usr/ccs/bin/pstack
But the respective user still is prompted for password, and even when the right password is used, the command is still not launched.$sudo usr/ccs/bin/pstack 26557
We trust you have received the usual... (5 Replies)
Discussion started by: black_fender
5 Replies
LEARN ABOUT HPUX
pthread_cond_broadcast
pthread_cond_signal(3T) pthread_cond_signal(3T)
NAME
pthread_cond_signal(), pthread_cond_broadcast() - unblock one or all threads waiting on a condition variable
SYNOPSIS
PARAMETERS
cond Pointer to the condition variable to be signaled or broadcast.
DESCRIPTION
The function is used to wake-up one of the threads that are waiting for the occurrence of a condition associated with condition variable
cond. If there are no threads blocked on cond, this function has no effect. If more than one thread is blocked on cond, the scheduling
policy determines which thread is unblocked. It is possible that more than one thread can be unblocked due to a spurious wakeup.
The function is used to wake-up all threads that are waiting for the occurrence of a condition associated with the condition variable cond.
If there are no threads blocked on cond, this function has no effect. If more than one thread is blocked on cond, the scheduling policy
determines the order in which threads are unblocked.
The condition variabled denoted by cond must have been dynamically initialized by a call to or statically initialized with the macro
An unblocked thread will reacquire the mutex it held when it started the condition wait before returning from or The threads that are
unblocked contend for the mutex according to their scheduling policy and priority.
The or functions can be called by a thread whether or not it currently owns the condition variable's associated mutex. For predictable
scheduling behavior and to prevent lost wake-ups, the mutex should be held when signaling a condition variable.
Usage
When using condition variables, there is a boolean predicate associated with each condition wait. If this predicate is false, the thread
should do a condition wait. Spurious wakeups may occur when waiting on a condition variable. Because the return values from and do not
imply anything about the value of this predicate, the predicate should always be re-evaluated.
Applications using condition variables typically acquire a mutex and enter a loop which checks the predicate. Depending on the value of
the predicate, the thread either breaks out of the loop or waits on the condition. On return from the condition wait, the predicate is re-
evaluated.
RETURN VALUE
Upon successful completion, and return zero. Otherwise, an error number is returned to indicate the error (the variable is not set).
ERRORS
For each of the following conditions, if the condition is detected, the and functions return the corresponding error number:
[EINVAL] cond is not a valid condition variable.
[EFAULT] cond parameter points to an illegal address.
AUTHOR
and were derived from the IEEE POSIX P1003.1c standard.
SEE ALSO
pthread_cond_init(3T), pthread_cond_wait(3T).
STANDARDS CONFORMANCE
Pthread Library pthread_cond_signal(3T)