Sponsored Content
Top Forums Shell Programming and Scripting trying to use logical or and i must be missing something Post 302590787 by crimso on Tuesday 17th of January 2012 02:27:00 PM
Old 01-17-2012
trying to use logical or and i must be missing something

greetings,
i am trying to force the user to ensure that $CPUS equals 12 or 24. it cannot be any other value including null. after the expr statement $AMT needs to equal 1 or 2. how i read the line in question is "if $CPUS is zero/null or not equal to 12 or not equal to 24" then issue the message, otherwise continue. what am i not getting here?

Code:
if [ "$CODE" = "comsol" ]; then
        if [ -z "$CPUS" ] || [ "$CPUS" != "12" ] || [ "$CPUS" != "24" ]; then
                echo ""
                echo "You must either specify 12 or 24 cpus for code Comsol"
                echo ""
                exit 1
        else
                AMT=$(expr $CPUS / 12)
        fi
RUSAGE="rusage [lic_req_comsol=$AMT:duration=15] span[host=$AMT]"
fi

thanx as always.

Last edited by crimso; 01-17-2012 at 03:33 PM.. Reason: forgot relevent part of code
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

logical if condition

hi i have the following scenario #!/bin/sh a=21.0 b=33.0 c=16.0 cmd=20 cmd1=30 if && ] then echo "problem....." exit 1 else echo "ok" exit 0 fi the issue here is the above condition is never TRUE coz a>cmd && b >cmd1 (7 Replies)
Discussion started by: nano2
7 Replies

2. Shell Programming and Scripting

Logical OR using sed

Hello, This must be a novice question to you folks. But I searched through various places and did not find an answer to this question: How do we perform a logical OR operation using sed command? For example, I want to write a command that extracts all the text between pattern1 and pattern2 OR... (0 Replies)
Discussion started by: thejasviv
0 Replies

3. Shell Programming and Scripting

How to do logical AND and logical OR with grep

Hi can someone please help me on this. I need to perform this code: Grep any lines that meets the following criteria (A AND B) OR (A AND C) I tried this code, but it didn't work Grep-I "A &&B" | "A&&C" *.* $ thanks in advance (12 Replies)
Discussion started by: Needhelp2
12 Replies

4. UNIX for Dummies Questions & Answers

problem using logical or

Hi, I have a script testor.s which takes a string as command line argument, Contents of the script: #!/bin/ksh -x if ] then echo "error" else echo "correct" fi Here, though i provide the command line argument as "WO_STMT_05292009", it displays error Is there... (3 Replies)
Discussion started by: Sheema
3 Replies

5. Shell Programming and Scripting

op of logical operator

Why the op of the following code is like this ???? i=4 j=-1 k=0 echo $? echo $? echo $? (5 Replies)
Discussion started by: lipun4u
5 Replies

6. AIX

Logical Partitions?

I'm trying to find out how many logical partitions our AIX box has. I'm running the command: topas -C and nothing is showing up. Is it safe to say that there is only one LPAR, which is what AIX is installed on? Move to AIX - jim mc (2 Replies)
Discussion started by: NycUnxer
2 Replies

7. SuSE

How to resolve missing missing dependencies with opensuse 11.3 and 12.3?

Hello, This is a programming question as well as a suse question, so let me know if you think I should post this in programming. I have an application that I compiled under opensuse 12.2 using g77-3.3/g++3.3. The program compiles and runs just fine. I gave the application to a colleague who... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

8. Red Hat

Yum - resolving missing dependencies that are not missing

I am trying to install VirtualBox on RHEL 5 but I need the 32 bit version for 32 bit Windows. When I run yum I get the following: sudo yum localinstall /auto/spvtg-it/spvss-migration/Software/VirtualBox-4.3-4.3.2_90405_el6-1.i686.rpm Loaded plugins: fastestmirror Setting up Local Package... (13 Replies)
Discussion started by: gw1500se
13 Replies
amtterm(1)						      General Commands Manual							amtterm(1)

NAME
amtterm - Intel AMT serial-over-lan (sol) client. SYNOPSIS
amtterm [ options ] host [ port ] DESCRIPTION
amtterm provides access to the serial-over-lan port of Intel AMT managed machines. host is the hostname or IP address of the machine amt- term should connect to. port is the tcp port to use and defaults to 16994 (standard AMT redirection port) if unspecified. For more inforamtions on Intel AMT check amt-howto(7). OPTIONS
-h Display help text. -v Be verbose (default). -q Be quiet. -u <user> Specify username, defaults to "admin". -p <pass> Specify password. amtterm will prompt on the terminal if unspecified. ENVIRONMENT
AMT_PASSWORD Default value for the password. SEE ALSO
gamt(1), amttool(1), amt-howto(7) AUTHOR
(c) 2007 Gerd Hoffmann <kraxel@redhat.com> (c) 2007 Gerd Hoffmann amtterm(1)
All times are GMT -4. The time now is 01:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy