## Problem in using AND OR condition together

Problem in using AND OR condition together
# 8
08-21-2009
Just seen the mans you suggested. Both of your solutions are really diffent.
Thanks
S
 sagar_evc View Public Profile for sagar_evc Find all posts by sagar_evc
# 9
08-21-2009

 cfajohnson View Public Profile for cfajohnson Find all posts by cfajohnson
# 10
08-21-2009
cfajohnson solution has shown that the parentheses in Frankin52's solution only clarified the command line.
 methyl View Public Profile for methyl Find all posts by methyl
# 11
08-22-2009
Quote:
Originally Posted by methyl
cfajohnson solution has shown that the parentheses in Frankin52's solution only clarified the command line.
IMHO the OP wants to test this condition (in C style):

The order of the test statements is significant, in the examples above the parentheses doesn't matter, but check the output of these commands:

 Franklin52 View Public Profile for Franklin52 Find all posts by Franklin52
# 12
08-22-2009
Regardless of the precedence the parentheses make the condition more readable.
I quite like the idea of bracketing both sizes of the and (&&):

 methyl View Public Profile for methyl Find all posts by methyl

Test Your Knowledge in Computers #654
Difficulty: Easy
DOS was initially released on the IBM System/360.
True or False?

## Condition problem

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...

## If condition problem

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

## Problem with IF condition .

Hi i am writing a script where i am running , 5 scripts together in 1 script . Now what i want is when these 5 scripts run completely , i should execute some other commands like i have compile the data etc. I have have 5 echo statements at the end of all those scripts . Like echo "1 is done" in...

## If condition problem

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...

## Problem in if condition

Hi all, I have task to delete two different files from all file system. one is core file & other is old file. i can delete core file but for old file i have to mv in different location. i wrote a script but it is not working. i have a two variables in this script first one is delcnt &...

## problem in if then else condition

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

## problem in if condition

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

## problem with if condition

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

## If condition problem

Hi Guys, I want to use if conition for my script. Before I used it tried it with some small test scripts. But it was not succeeded. My script and screen output as follows, Script: echo 'Do you think Yes or No (y/n) : ' read ans echo You input anser as \$ans ans1=y if ( \$ans == \$ans1...