Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2006
    Posts
    1

    Unanswered: Test for numeric / non-numeric

    How do I test user input to detect if it is valid numeric input ?

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1

    Test for a numeric

    Code:
    case $n in 
         *[!0-9]*) printf "%s\n" "Not a number" ;; 
    esac

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •