Sponsored Content
Full Discussion: multiple condition in if
Top Forums Shell Programming and Scripting multiple condition in if Post 302354225 by user7509 on Thursday 17th of September 2009 01:38:47 PM
Old 09-17-2009
Hi

I tried with following combinations,

if [[ $z -gt 5 -a $z -lt 7 ] -o [ $y == 'VALID' ]]

if [ $z -gt 5 -a $z -lt 7 -o $y == 'VALID' ]

if [ $z -gt 5 ]-a [ $z -lt 7 ] -0 [ $y == 'VALID' ]

nothing is working fine.

Can you please provide the correct one
 

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

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

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

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

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

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

7. Shell Programming and Scripting

Multiple if condition

Hi, I wanted to satisfy two requirements to proceed to do a task One of them is to calculate between two metrics and the other to check one of the file not empty if the condition matches the above two, it should proceed with the task below is the snippet of it, however when i run the script... (3 Replies)
Discussion started by: ajothi
3 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
HESINFO(1)						    BSD General Commands Manual 						HESINFO(1)

NAME
hesinfo -- find out what is stored in the Hesiod database SYNOPSIS
hesinfo [-bl] HesiodName HesiodNameType DESCRIPTION
hesinfo takes two arguments, a name to be resolved and a string, known as a HesiodNameType. It then prints the information returned by the Hesiod nameserver. The value returned by hesinfo is of the type HesiodNameType. hesinfo understands the following options: -l Selects long format. -b Prints the fully-qualified string passed to the nameserver. VALID Hesiod_Names The following types of identifiers may be used in the HesiodName argument to hesinfo. These values will be resolved by accessing the hesiod(3) database. <username> the 8-character-or-less string used to identify users or classes (e.g. joeuser, root, 1.00, etc). Used with the Hesiod_Name_Types passwd, pobox, and filsys. <uid> the id number assigned to a user. <groupid> the id number assigned to a group. <groupname> a name identifying a unique group. <file-system-name> the name of an athena file system. <rvd server>:<pack> the name of an rvd's server and pack separated by a colon. <nfs server>:<partition> the name of an nfs server and its partition separated by a colon. <workstation-name> the machine name of an Athena workstation (e.g. E40-343-3). <service-name> name of an Athena service (e.g. Zephyr). <service-type> name of Unix service (valid entries are defined in /etc/services). <printer-name> name of a printer. <printer-cluster-name> name of an Athena print cluster. <foo> some hesinfo calls (e.g., prclusterlist) do not require a specific HesiodName argument. However, you must include a dummy string (e.g., ``foo'') for hesinfo to work properly. VALID Hesiod_Name_Types The following symbols are valid substitutions for the HesiodNameType argument to hesinfo. passwd returns string suitable for inclusion in /etc/passwd, searching with <username>. pobox returns information on the pobox assigned to the user specified by HesiodName, searching with <username>. uid returns string suitable for inclusion in /etc/passwd, searching with <uid>. gid returns string suitable for inclusion in /etc/group, searching with <groupid>. group returns string suitable for inclusion in /etc/group, searching with <groupname>. grplist returns subgroups included in superset defined by <groupname>. filsys returns file system type, export point, server, mount mode, and import point for the following valid HesiodNames (see above) - <file system name>, <username>, <rvd server>:<pack>, and <nfs server>:<partition>. cluster returns information about the local cluster the workstation, specified by <workstation name>. Included is information about the local file and print servers. This information is accesses by clusterinfo at boot time. sloc returns network name of service host for <service-name>. service returns Internet protocol type and protocol service port for <service-type>. pcap returns a valid entry for /etc/printcap for <printer-name>. prcluserlist returns a list of print clusters. prcluster returns a list of printers in a cluster specified by <printer-cluster-name>. FILES
/etc/hesiod.conf SEE ALSO
hesiod(3), named(8) Hesiod - Project Athena Technical Plan -- Name Service. AUTHORS
Steve Dyer, IBM/Project Athena Copyright 1987, 1988, 1996 by the Massachusetts Institute of Technology. BSD
October 27, 1996 BSD
All times are GMT -4. The time now is 09:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy