8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Gurus,
I have a command to assign value based on input value.
current condition is "if pattern matches "case", then assign "HOLD" else "SUCC"right now, I need to add one more condition (variable name is VAR).
the condition is "if pattern1 matches "case", then assign "HOLD" else if... (2 Replies)
Discussion started by: ken6503
2 Replies
2. UNIX for Dummies Questions & Answers
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
3. Shell Programming and Scripting
HI
My doubt may be basic one but I need to get it clarified..
When i use "if" condition that checks for many AND, OR logical conditions
like
if ]; then
return 0
fi
Even the if condition fails it returns as zero.. Any clue..
But if i add else condition like
if ]; ... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies
4. Shell Programming and Scripting
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
5. Shell Programming and Scripting
hi,
I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command
Here are my simple script
After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
Discussion started by: jao_madn
3 Replies
6. Shell Programming and Scripting
Trying to clean up the last little thing in this script which is that the mv always performs no matter whether it is needed or not. It doesn't cause any bugs just prints an unsightly "can't mv source and dest are the same". Obviously I want to get rid of it but having issues getting the... (4 Replies)
Discussion started by: Calbrenar
4 Replies
7. HP-UX
Executed the following if conditions .. and got different results .
only (( )) gave correct o/p with all scenarios .
Can anybody please let me know what is the difference between and ] and ((condition)) when used with if condition.
And why each condition gave different result.
1.... (2 Replies)
Discussion started by: soumyabubun
2 Replies
8. Shell Programming and Scripting
Is there any way to do variable nesting using sh?
For example:
example_1="a test string"
example_2="another test"
example_3="etc..."
i=2
echo ${example_$i}
The shell reports:
sh: ${example_$i}: bad substitution
If not, maybe someone could suggest another method. Thanks in... (3 Replies)
Discussion started by: kevinl33
3 Replies