Sponsored Content
Full Discussion: Nested If question
Top Forums UNIX for Dummies Questions & Answers Nested If question Post 302140052 by jim mcnamara on Wednesday 10th of October 2007 02:33:31 PM
Old 10-10-2007
You have it right. Except the -a should maybe be a -f because -a means "and" which makes no sense in what you posted
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

nested looping question

Hi, I'm having some trouble with the syntax in constructing a simple nested 'for' loop. My code is as follows: #!/bin/bash dir1="fred flume haystack" for dir2 in ${dir1} do fred="1 2 3" flume="a b c" ... (7 Replies)
Discussion started by: Sn33R
7 Replies

2. Shell Programming and Scripting

Nested Symlinks?

Please don't laugh or call me a fool... I'm trying to set up a script that will go through my Music File directory and generate a set of symbolic links in a directory called "What's New". Within that directory there will be a "30 Days", "3 Months", "6 Months" and "A Year" directories. Within... (0 Replies)
Discussion started by: deckard
0 Replies

3. UNIX for Dummies Questions & Answers

Nested If statement within Do / Done

Hi all! I'm really hoping you can help me out here; now i have searched and searched and have at least worked out that you can't have a nested if statement with a 'done' in it (as i have) as you're killing the parent before the child. So here's what i have, and here's hoping someone can help... (2 Replies)
Discussion started by: dalgibbard
2 Replies

4. Shell Programming and Scripting

Nested if question BASH

Just started learning bash ,and I am confused with sintaksis line 16: syntax error near unexpected token `else' thanks #!/bin/bash echo -n "Enter: " read num if(($(echo ${#num}) == 0 )) then echo No arguments passed.Try again elif rem=$(echo $num | tr -d ) ... (7 Replies)
Discussion started by: lio123
7 Replies

5. UNIX for Dummies Questions & Answers

Bourne-sh (not bash) question about nested loops and sed

Here's the input: alpha, numeric or alphanumeric string ("line 1 string") numeric string ("line 2 string") numeric string ("line 3 string") numeric string ("line 4 string") ... where - each numeric string is in a pattern that can be matched with RE but - there can be any number of... (2 Replies)
Discussion started by: uiop44
2 Replies

6. Shell Programming and Scripting

syntax question in regards to nested awk statements

Hello all, I am writing up an input file and I was hoping I could get some guidance as to how to best consolidate these 2 awk statements for 1 while loop. Here's my input file # cat databases.lst #NOTE: These entries are delimited by tabs "\t" #oracleSID name/pass # db11 ... (2 Replies)
Discussion started by: Keepcase
2 Replies

7. Shell Programming and Scripting

nested if else -error

HI everyone, I am not able to find error in the script, when i run the script till line No. 20 i.e, read var4 everything runs fine. After that the script exits out. #!/bin/bash echo -e "Want dryrun OR merge: \n " read var1 if ] ; then echo -e "\n Please select from the given... (10 Replies)
Discussion started by: rishi.aradhya
10 Replies

8. Shell Programming and Scripting

Nested if else

Hi, i m trying to create script which logic is like below. if ; then x=`cat /tmp/testoutput.log | grep STOP | wc -l` y=`cat /tmp/testoutput.log | grep RUN | wc -l` if ; then echo "process stop" if ; then echo "process running " else echo "file not found" fi ----------------... (2 Replies)
Discussion started by: tapia
2 Replies

9. UNIX for Dummies Questions & Answers

[Solved] Nested If

I am having a problem with a nested if. I am sure I am overlooking something. I check for the existence of $Pidfl3 and it exists, o this condition I then want to check for the existence of a next file and remove it. The first if is executed, but on the second if I get test: argument expected. My... (4 Replies)
Discussion started by: Charles Swart
4 Replies
postwait(2)							System Calls Manual						       postwait(2)

NAME
postwait: pw_getukid(), pw_wait(), pw_post(), pw_postv(), pw_getvmax() - lightweight synchronization mechanism SYNOPSIS
DESCRIPTION
Postwait is a fast, lightweight sleep/wakeup mechanism that can be used for synchronization by cooperating kernel threads within a single process or between separate processes. A thread calls to block. It resumes execution when it is posted by another thread, the call expires, or is signaled. If one or more posts are already pending, returns immediately. Threads using postwait are identified by their ukid. A thread retrieves its ukid by calling It shares this ukid with anyone it chooses by any means it considers appropriate (for example, shared memory). is called with a timeout ts. If ts is NULL, the thread will not timeout. It will remain blocked until posted or a signal wakes it up. If ts points to a zero-valued timespec, will return immediately with a value (and indicating whether or not it was posted. If ts points to a timespec whose value is greater than zero, the thread will block for that amount of time unless it is posted or inter- rupted by a signal, in which case the timespec pointed to by ts is updated with the remaining time. The return value and are set to indi- cate the reason the call returned. is used to post many threads with a single call. It posts to all threads in the targets array. An value for each target is returned in the errors array. (0 indicates success.) If the errors pointer is zero, no target-specific errors are copied out. There is a maximum number of threads that can be posted with a single call. This value is returned by Posts sent to a kernel thread that already has a post pending against it are discarded. RETURN VALUE
returns 0 if it succeeds, -1 otherwise. returns 0 if posted, -1 otherwise. returns 0 if the post succeeds, -1 otherwise. returns 0 if every post succeeds, -1 otherwise. returns the maximum number of kernel threads that can be posted with a single call to ERRORS
sets to one of the following values if it fails: ukid points to an illegal address. The reliable detection of this error is implementation dependent. sets to one of the following values if it fails: was called with a timeout of 0 but the caller has no post(s) pending. was called with a timeout that expired. ts points to an illegal address. The reliable detection of this error is implementation dependent. was interrupted by a signal. The timespec pointed to by ts is invalid. sets to one of the following values if it fails: The ukid refers to a non-existent kernel thread. sets to one of the following values if it fails: targets points to an illegal address. The reliable detection of this error is implementation dependent. errors points to an illegal address. The reliable detection of this error is implementation dependent. count is less than 0. count exceeds the maximum value (as returned by A ukid refers to a non-existent kernel thread. postwait(2)
All times are GMT -4. The time now is 07:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy