Validate User Input is 16bit signed integer

Discussion of programming on Linux, including shell scripting, perl, python, c/c++, mono, java. Whatever tickles your fancy.
mudasir
Captain
Posts: 565
Joined: Tue Oct 17, 2006 5:23 am
Location: Dubai
Contact:

Validate User Input is 16bit signed integer

Postby mudasir » Thu Oct 01, 2009 2:12 am

Assalam-o-alaikum,

I am making a shell script in which i need user to input a Signed 16bit Integer as arguments to the script.
The script will take 6 arguments which all should be Signed 16bit integer.

I would like to know how can i verify that the value that user has input is a Signed 16bit integer. I need to verify $1 $2 $3 $4 $5 $6.

Looking for a positive and quick reply.
Kind Regards
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com

LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Postby LinuxFreaK » Thu Oct 01, 2009 8:30 am

Farrukh Ahmed

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Postby lambda » Thu Oct 01, 2009 9:33 am

Watch out for the !
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?

mudasir
Captain
Posts: 565
Joined: Tue Oct 17, 2006 5:23 am
Location: Dubai
Contact:

Postby mudasir » Thu Oct 29, 2009 8:37 am

Kind Regards
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Postby lambda » Thu Oct 29, 2009 11:20 am

Watch out for the !
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?

azfar
Captain
Posts: 598
Joined: Tue Mar 23, 2004 1:16 am
Location: Karachi
Contact:

Postby azfar » Sat Oct 31, 2009 3:36 pm

Azfar Hashmi
Email : azfarhashmi@hotmail.com


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest