![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ksh How to test if variable is numeric?? | developncode | UNIX for Dummies Questions & Answers | 8 | 03-19-2009 06:42 PM |
| Test variable | javeed7 | Shell Programming and Scripting | 2 | 04-19-2008 07:59 PM |
| Test whether absolute path in variable | dkieran | Shell Programming and Scripting | 2 | 05-21-2007 05:14 PM |
| test Null variable | kykyboss | Shell Programming and Scripting | 1 | 11-24-2006 12:02 PM |
| How to test if a variable is in the right format | dbrundrett | Shell Programming and Scripting | 2 | 07-05-2004 07:05 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
variable numerical test
Hi
I have a variable which should be any number between 1 and 50. It could also be any string/empty string. I have a code written below. The point is when the variable contains string. I don't want the code below to error out. Instead fall in the else bucket. Code:
[ $var -lt 1 -o $var -gt 50 ] && dothis_1 || dothis_2 |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|