- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: if statement comparing two digit value against...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2005 04:30 AM
04-08-2005 04:30 AM
if statement comparing two digit value against single digit value
Thanks
-Laura
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2005 04:37 AM
04-08-2005 04:37 AM
Re: if statement comparing two digit value against single digit value
will fix you. You are doing a numeric comparision with -ge, -gt, -lt, -le, -eq, and '-ne' otherwise you are doing a LEXICAL comparison.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2005 04:48 AM
04-08-2005 04:48 AM
Re: if statement comparing two digit value against single digit value
TEST: not found
+ [[ -gt 5 ]]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2005 04:49 AM
04-08-2005 04:49 AM
Re: if statement comparing two digit value against single digit value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2005 04:52 AM
04-08-2005 04:52 AM
Re: if statement comparing two digit value against single digit value
Testing Numeric Values
n1 -eq n2 --n1 equals n2
n1 -ge n2 --n1 is greater than or equal to n2
n1 -gt n2 --n1 is greater than n2
n1 -le n2 --n1 is less than or equal to n2
n1 -lt n2 --n1 is less than n2
n1 -ne n2 --n1 does not equal n2
String Conditions
-n s1 --string s1 has non-zero length
-z s1 --string s1 has zero length
s1 = s2 --strings s1 and s2 are identical. In Korn shell, s2 can be a regular expression.
s1 != s2 --strings s1 and s2 are not identical. In Korn shell, s2 can be a regular expression
s1 < s2 --ASCII value of s1 precedes that of s2 (valid only within [[]] construct) (K)
s1 > s2 --ASCII value of s1 follows that of s2 (valid only within [[]] construct) (K)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2005 04:53 AM
04-08-2005 04:53 AM
Re: if statement comparing two digit value against single digit value
That was it. Thank you. I knew it was something so simple. I appreciate your very prompt response on this.
-Laura
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2005 04:54 AM
04-08-2005 04:54 AM
Re: if statement comparing two digit value against single digit value
Thanks for that. I will copy that down to my laptop and keep it for reference.
-Laura