Sponsored Content
Full Discussion: Multiple if condition
Top Forums Shell Programming and Scripting Multiple if condition Post 302741239 by vgersh99 on Friday 7th of December 2012 04:45:11 PM
Old 12-07-2012
Code:
if [ condition1 -a condition2 ]; then

This User Gave Thanks to vgersh99 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Multiple Condition If statement

Hi, I would like to create an IF statement where if a variable is equal to at least one of 2 (or more) values then the script proceeds. For example: TEST_VAR=2 if ; then echo success! else echo failure fi I understand that the above syntax is wrong but I feel it must be close. Any... (1 Reply)
Discussion started by: msb65
1 Replies

2. Shell Programming and Scripting

multiple condition in if

All, My environment is Red Hat Enterprise Linux 5. I am using the following condition -- if -0 ] above command is not working. It is telling that -a unexpected. Please help me (10 Replies)
Discussion started by: user7509
10 Replies

3. Shell Programming and Scripting

awk with multiple condition

Hi Guys, I just wanted to print all the lines execpt 1st and 3rd line. For that i wrote a awk command, awk 'NR != 1 || NR != 3 {print $0}' c.out the command is working if i give an equal to instead of not equal to. In the case of not equal to, it gives me the entire file. Can you... (18 Replies)
Discussion started by: mac4rfree
18 Replies

4. Shell Programming and Scripting

multiple echo statements in if condition

Hi , I have a peculiar problem. i have an if block like this if ; then echo " todays date is " ${date} >> log_file echo " file count is " $ count >> log_file mv filename1 filename 2 else echo "no files available ">> log_file fi the echo statement "no files available " is not... (2 Replies)
Discussion started by: wizardofoz
2 Replies

5. Shell Programming and Scripting

Multiple condition checking in bash

Hi All, I am trying to check if two variables have value assigned to it. i am doing it like if ] then echo "Please specify either single hostname or host file for the report" usage exit fi But its not working for it.Even i specify values for both variables it dont go... (6 Replies)
Discussion started by: kailash19
6 Replies

6. Shell Programming and Scripting

multiple condition matching and doing some predefined work

Hi everybody, I had 10 files in in one folder(/home/sai/) namely sai. 1.gz,2.gz,3.gz ..,10.gz. I want to delete the files which are there home based on the following conditions fliecount in sai folder==10 && grep -cv ".gz"==0 How to check this using awk? Otherwise please... (2 Replies)
Discussion started by: p_sai_ias
2 Replies

7. UNIX for Dummies Questions & Answers

LINUX Multiple condition in IF Statement - Pls help

Hi All, I am trying to put multiple conditions in an IF Statement (using $$). the Linux script somehow doesnt like it. The logic I am trying to implement is as follows, 1. I will first search for DateFile.txt 2. If it exists & there is a P_BUS_DATE value in it, then assign the date value... (5 Replies)
Discussion started by: dsfreddie
5 Replies

8. Shell Programming and Scripting

Reading multiple lines with condition

Hi guys, I need to read following lines and put them in same row …. text: Abcd5437_XYA0_B1_WXYZ_BE 99:00:14:42:55:01:d4:22 99:00:14:42:70:01:d4:22 99:00:14:42:55:03:a0:22 99:00:14:42:70:03:a0:22 ... (4 Replies)
Discussion started by: dc@bos
4 Replies

9. Shell Programming and Scripting

Executing multiple scripts using if condition

I have an if condition. If that condition is true then one script will be run and after that I need to check another condition based on the output value of first script. i tried like below : cd lock if ; then rm exitup if ; then kb_shutdown kb_startup if ; then rm exitup if ;... (3 Replies)
Discussion started by: charanarjun
3 Replies

10. UNIX for Beginners Questions & Answers

Need help search multiple condition from a file.

OS: window 7 shell : korn shell I have 2 file , i'm need grep data according File_1 from file 2. File_1 CAL_ENAB_N_4_ $2N12743_29 +12V File_2 NODE CAL_ENAB_N_4_ PINS 21548; PROBES P1465 3651, 46900 tn2700.1 LWT; WIRES (6 Replies)
Discussion started by: kttan
6 Replies
DEALER.DPP(6)							User Documentation						     DEALER.DPP(6)

NAME
dealer.dpp - preprocessor for dealer scripts SYNOPSIS
dealer.dpp [inputfile] DESCRIPTION
dealer.dpp stands for dealer-pre-processor. Its main purpose it to preprocess input files for Hans van Staveren's great dealer program. SYNTAX
The program expands shape specifications of the form: shape{COMPASS, shp1 + shp2 + ... + shpM - shm1 - ... - shmN} regular shapes 7xxx, 4432, 4xx5 have the same meaning as in original dealer. the `at least' operator whenever you put a `+' after a suit-length, it means `at least'. shape{north, 5+xx5+}: at least 5/5 in the blacks, -->shape(north,5xx5 + 5xx6 + 6xx5 + 5xx7 + 6xx6 + 7xx5 + 5008 + 6007 + 7006 + 8005) the `at most' operator: same as the `at least', just use a `-': shape{north, 2-xxx}: at most 2 spades, -->shape(north,0xxx + 1xxx + 2xxx) the `range' operator: the range operator operates on a single suit. It comes with [], like in Perl. shape{north, x[3-5]x[13]}: (3 to 5) hearts, and one or 3 clubs -->shape(north,x3x1 + x4x1 + x3x3 + x5x1 + x4x3 + x5x3) Note that shape{north, 3-xxx} is equivalent to shape{north,[0-3]xxx} You can write compound ranges if you want: shape{north, [013-68]xxx} means: 0,1,3,4,5,6 or 8 spades. the `permutation' operator: the permutation operator will appears as () like in the WBF rules of specifying shapes. shape{north, (4432)}: any 4432 hand. -->shape(north,any 4432) what's best is that the () operator can operate on restricted groups of cards: shape{north, 5s(431)}: 5 spades, the others suits being(431). -->shape(north,5134 + 5314 + 5143 + 5341 + 5413 + 5431) What you have to do is: o specify the suit names (s,h,d,c in english) in the left part of the shape, in any order, o and enclose the rest of the permutation into () in the right part. A (complicated) example: shape{north, 4+c3+d(2+2+)}: at least 5 clubs, at least 3 diamonds, and no short major. -->shape(north,3334 + 4234 + 2434 + 3244 + 2344 + 2254 + 3235 + 2335 + 2245 + 2236) the `Major' operator: has to be used together with the () operator. `M' stands for `a major' The `M' operator can only be used in the left part (never put a M inside the parens) shape{north, 5M(xxx)} -->shape(north,x5xx + 5xxx) shape{north, 5+M3+c(31)} -->shape(north,1534 + 3514 + 1633 + 3613 + 5134 + 5314 + 6133 + 6313) the `minor' operator: same as the `Major' operator, but in lowercase `m'. shape{north, 5M5m(xx)} -->shape(north,x5x5 + 5xx5 + x55x + 5x5x) the `conditional' operator: you've got the possibility of specifying complex conditions to be verified that cannot be simply expressed by other operators. In order to do that, you use the `:' operator, just after the atomic-shape specification: shape{north, shp1:condition1,condition2,...} The conditions use the letters (s,h,d,c) as variables for the suit lengths, and the usual C-operators (*,+,-,/,>,<,==,!,?, and so on). Note that the `,' stands for the `and-logical' operator. You can use `or' for the `or-logical' operator. shape{north, 4+s4+h(xx):d>c,h+s==10} -->shape(north,6421 + 6430 + 5521 + 5530 + 4621 + 4630) EXAMPLES
a balanced hand (3+3+3+2+) a french 1H opening x5+xx:h>s,h>=d,h>=c my No_trump opening hn = hcp(north) n1NT = (hn > 14 and hn < 18 and shape{north, 5m(332) + 5m2s(42)} ) or (hn > 13 and hn < 17 and shape{north, 6m(322)} ) or (hn > 15 and hn < 18 and shape{north, 5M(332)} ) or (hn > 15 and hn < 19 and shape{north, (4432) + (4333)} ) SEE ALSO
dealer(6), /usr/share/doc/dealer/Manual. AUTHORS
Francois Dellacherie Manpage: Christoph Berg <cb@df7cb.de> LICENSE
This program is hereby put in the public domain. Do with it whatever you want, but I would like you not to redistribute it in modified form without mentioning the fact of modification. I will accept bug reports and modification requests, without any obligation of course, but fixing bugs someone else put in is beyond me. Dealer 2012-03-04 DEALER.DPP(6)
All times are GMT -4. The time now is 03:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy