I'm afraid that using the result of a "command substitution" for an if condition is not too good an idea, as the shell it will try to run the result line as a command which will most probably fail.
What makes me somewhat hesitant is that
doesn't seem to produce a result as can be seen in the output in lines 8 and 9. grep not producing an output line - and be it through the -v option - will yield the exit code 1 which is interpreted as FALSE.
Please show the result of the command
in your function. Is it possible the $ORACLE_SID has non-printing control chars in it?
hi, :)
pls consider the following if statement
if //g') ]
then
........
else
.......
when i execute the script i am getting the following error
'(' unexpected
I am not able to find the mistake.
could anybody tell where i did mistake.
cheers
RRK (13 Replies)
hi,
actully i need the belp for the below.
host_list=" Host1 host2 host3 host4 "
n=`hostname`
i need to put the condition like the below
if n is among the host mention in the host_list if
then
#some stugg
else
# some other stuff
fi (1 Reply)
Hi ,
I am trying the following simple script . But it is always giving 1 output. Dont know why
#!/bin/sh
find . -name "a.log"
if ; then
echo "1"
else
echo "0"
fi
Kindly advice. it is giving 1 output even when the a.log file is not there (26 Replies)
a=rhino
b=crocodil
c=testsc
if && "$c" = testsc ]
then
echo "Test #5 succeeds."
else
echo "Test #5 fails."
fi
i need to test or condition before check the output with AND condition. ur help is much appreciated... (11 Replies)
Hi all,
Thanks in advance for your time.
I have a data file like this:
1 7.465753425
2 8.980821918
1 1.717808219
1 6.550684932
0 5.432876712
I wish to write a bash script to check both columns and output a 1 if col1==1 AND col2<3. Otherwise I want to output a 0. In the above... (5 Replies)
Hi,
I need to use if condition for search a file pattern on a particular location.
cd $file_Path
if ||
then
do this
else
do that
fi
Can someone help me with the if part, how i can put those conditions?
make sure format should be *.file* and *.file
file is a keyword which i... (5 Replies)
Hi, I'm writing a bash script and i have a condition that goes
if
then
break
fi
but, when i go to run it, i come across this
line 10: '
where line 10 is the if
I don't know what's going on :( (2 Replies)
Hi, below is the script in ksh and i am having issues with if condition.
It takes in one argument as input and executes the shell script.
The problem is in if condition in shell script. If input is given as 1 it works out well. But if input is given as 2 or something else the script is failing to... (1 Reply)
Hi All,
I am using below if condition to check whether null is passed as a parameter to the program
if or ;
then
echo "ABC">>$FILE
else
echo "CDF">>$FILE
fi
However it is saying me null=null command not found . Please help me with this (9 Replies)
Hi All,
Seeking for your assistance on how to condition it correctly.
cat file1.txt
290,1663,43,888,0,0.00,86.91,0.00,26.98,0.00
290,1663,52,0,0,0.00,0.00,0.00,0.00,0.00
290,1663,52,888,0,0.00,34.60,0.00,9.00,0.00
1st scenario:
if the fourth column contains 888s and 0s it is by... (16 Replies)