Computing.Net > Forums > Unix > TCSH Scripting Help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

TCSH Scripting Help

Reply to Message Icon

Name: Phoenix940
Date: September 21, 2008 at 22:53:05 Pacific
OS: Linux
CPU/Ram: x64/2048Mb
Product: ??
Comment:

Hey. My problem is I am trying to write a tcsh script and I need to insure all my arguments are numerical. My solution to the problem was to do:
@ test = $argv[$x] >& tempfile
#Where x is the given argument number
if ( `cat tempfile` == "@: Expression Syntax.") then
echo " Non-numerical input given"
endif

The problem seems to lie in the fact that the first command (@ test...) produces error and exits the script. If I remove it the test works fine, but I need that for it to work with any given inputs. How can I get TCSH to continue to run even with the error output? Is there a better way to determine if input is numerical? I have the rest of the script written so I really don't want to change to a different shell for the script.



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: TCSH Scripting Help

Unix script help www.computing.net/answers/unix/unix-script-help/6110.html

Korn script help!! www.computing.net/answers/unix/korn-script-help/4858.html

Shell Scripting Help www.computing.net/answers/unix/shell-scripting-help/5020.html