That might actually have been a better way to do it.
The reason your first try didn't work because "or" wasn't really what you wanted. You flipped the logic with the !=, which changes the picture a bit -- a string can't possibly be equal 12 and 24 at the same time! One or the other, or both, will always be false, flipping that makes one or the other always true; and or-ing that produces a statement which is always true no matter what.
To do it with ||:
I think the -z is superfluous, then, since a null string will never equal 12 or 24.
Last edited by Corona688; 01-17-2012 at 05:20 PM..
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT OSF1
strcasecmp
strcasecmp(3) Library Functions Manual strcasecmp(3)NAME
strcasecmp, strncasecmp - Perform case-insensitive string comparisons
LIBRARY
Standard C Library (libc.so, libc.a)
SYNOPSIS
#include <strings.h>
int strcasecmp(
const char *s1,
const char *s2
int strncasecmp(
const char *s1,
const char *s2
size_t n;
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
strcasecmp(), strncasecmp(): XPG4-UNIX
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
Points to a location containing first string. Points to a location containing the second of two strings referenced. Specifies the maximum
number of bytes to compare.
DESCRIPTION
The strcasecmp() function compares the string pointed to by the s1 parameter to the string pointed to by the s2 parameter, while ignoring
differences in case. The strncasecmp() function is similar to the strcasecmp function, but also compares size. If the size specified by n
is reached before a null, the comparison stops. Note that these functions work for 7-bit ASCII compares only and should not be used in
internationalized applications.
RETURN VALUES
Upon completion, the strcasecmp() function returns an integer whose value is greater than, equal to, or less than 0 (zero), according to
whether the s1 string, ignoring case, is greater than, equal to, or less than the s2 string.
Upon successful completion, the strncasecmp() function returns an integer whose value is greater than, equal to, or less than 0 (zero),
according to whether the s1 array (possibly null-terminated), ignoring case, is greater than, equal to, or less than the s2 string (possi-
bly null-terminated).
RELATED INFORMATION
Functions: string(3), strcat(3), strcmp(3), strcpy(3)
Standards: standards(5) delim off
strcasecmp(3)