|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by guochu in Scripting Languages, csh / tcsh, Shell Scripting
I am looking for an example of csh script to test the input is a positive integer. Any input can help!!! Thanks!
My one didn't work
--------------------------
echo -n "Please enter a positive integer "
set input=$<
if ($input contains '-' || $input contains '.') then
echo "wrong input"
else
echo "input accepted"
endif
--------------------------
-
my problem is that I don't know how to grep the $input whether or not has a symbol minus sign i.e. '-' or decimal sign i.e. '.'
20091111-EE-VQP-89 - Hierarchy / EE_QW_2_20070628