Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2006
    Posts
    2

    Unanswered: test imput in cshell

    Hi everyone,

    I need to test imput in a cshell script.
    The imput is only numeric, any letter,
    How I can do this? I read a lot about test conditions but I dont find the check that I need.
    Could you help me please?

    Thanks

    Bonovox


  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Don't use csh to write a script.

    A simple test for a numeric argument, in a standard shell is:
    Code:
    case $n in 
         *[!0-9]*) printf "%s\n" "Not a number" ;; 
    esac

  3. #3
    Join Date
    Oct 2006
    Posts
    2
    thanks a lot

Posting Permissions

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