![]() |
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] Check input numbers | waso | Shell Programming and Scripting | 6 | 10-01-2009 04:44 PM |
| Bash : how do i check the user input and make sure is only chracter or only number ? | CheeSen | Shell Programming and Scripting | 7 | 09-07-2008 07:06 AM |
| check the input | Shilpi | UNIX for Dummies Questions & Answers | 1 | 03-04-2008 08:26 AM |
| Check on Input | dhananjaysk | Shell Programming and Scripting | 3 | 03-13-2006 01:55 PM |
| What can i do to check that the input is all alphabet.. ? | XXXXXXXXXX | Shell Programming and Scripting | 4 | 02-19-2002 07:09 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||||
|
Not sure what you were trying to achieve with both the check_it function and the case statement. You can do it all using a case statement as shown in the following example
Code:
#!/usr/bin/bash shopt -s extglob INPUT="123456" case $INPUT in ( +([[:digit:]]) ) echo "INPUT is all numbers" ;; *) echo "INPUT is not all numbers" ;; esac |
|
|||||
|
Quote:
Code:
/app/av/test/test.sh 12 first i must check if is $1 number and not text second $1 must be number betwin 1-12, and cant have leading zeroes for number 1-9 Last edited by waso; 1 Week Ago at 11:17 AM.. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|