10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I am analyzing one of the scripts written by another person.script is having multiple if conditions and everything are nested.The code is not formatted properly.Is there any way to identify in Unix to identify begin and end of a particular if block? (6 Replies)
Discussion started by: vamsi.valiveti
6 Replies
2. Shell Programming and Scripting
In the below awk in the first step I default Classification NF-1 to VUS. Next, I am trying to change the value of Classification (NF) to whatever CLINSIG (NF-1) is. If there is only one condition everything works great, but if there are two conditions it does not work. Is the syntax used... (4 Replies)
Discussion started by: cmccabe
4 Replies
3. Shell Programming and Scripting
Fellas,
Am new to unix os/ and here the situation , I am trying to write multiple condition statement inside if but it throws me a error
here is my piece of code ,
if ] && ] && ]
then
commands
fi
error : line 15 : `
can someone please advise me how to fix it
Please use... (7 Replies)
Discussion started by: xeccc5z
7 Replies
4. Shell Programming and Scripting
There are 4 ways the user can input data and unfortunately the parse rules for each are slightly different. The first condition works great and the input file is attached for the second condition. Conditions 3 and 4 will follow I'm sure I will have trouble with them and need help as well. The... (9 Replies)
Discussion started by: cmccabe
9 Replies
5. Shell Programming and Scripting
Hi
I wanted to search for 2 patterns. These patterns are matched only if the if condition is matched for example:
This is the kind of command that I have in mind which is obviously not correct:
awk '/abc/ if ($1>10) {print);/xyz/ if ($2>5) {print)' myfile
myfile:
12 14 3 20 45 abc
21 ... (7 Replies)
Discussion started by: zorrox
7 Replies
6. UNIX for Dummies Questions & Answers
Hello Unix-Forums!
It has been a long time since my last post, but finally I've got a new question:
I know in case you can use multiple patterns by
case $var in
a|b|c|ab)
and so on.
But how would I place an OR between
if ]
then
...
if ]
then
...
I want to execute the "..." if... (3 Replies)
Discussion started by: intelinside
3 Replies
7. Shell Programming and Scripting
Hi All,
I am new to shell scripting.
Can any one say what is wrong in this if statement, that uses multiple conditions
if
then
***************
else
if ( -z $pcs && "$night_time_calc" > "$night_time" )
then
********************************
... (4 Replies)
Discussion started by: ssenthilkumar
4 Replies
8. Shell Programming and Scripting
Guys, Im trying to have a script that evaluates multiple conditions :
test.sh:
if
then
echo "host $1"
else
if
then
echo "host $1"
else
echo $1 not valid
exit 1
fi
when I do
./test.sh brazil1
I get: (4 Replies)
Discussion started by: bashshadow1979
4 Replies
9. UNIX for Dummies Questions & Answers
Hello,
I am having trouble with the syntax with a conditional statement in a BASH script involving multiple conditions. Any suggestions would be greatly appreciated!
if ; then
array=("${array}" "$dnNum" )
fi
i receive this error:
./testscript: ' (4 Replies)
Discussion started by: grandtheftander
4 Replies
10. Shell Programming and Scripting
Hi all, I'm confused about the proper syntax for multi-conditional if then statements. I'm trying to set limitations on info input on the command line.. i.e.
if ] ;then
$x=$vr1
else
print "You have entered an invalid option."
Can someone please clue me in on what is wrong with my syntax;... (3 Replies)
Discussion started by: tim mauger
3 Replies