On Thu, 30 Sep 1999, Dan "BUTTER" wrote:
> Is there a way to debug scripts???
> What`s the best way yo debug/compile csh scripts????
1. don't use 'csh' to writes scripts if you have a choice. turn to
perl/python, or at least to 'sh'.
2. if you still need to write csh scripts, use the 'ecoh' command very
frequently to emit output - the script may terminate at any given point
due to syntax errors (syntax is not checked during script launch, but
rather during execution of each command).
3. in order to see the command flow of the script while it executes, make
sure it begins with the following line:
#!/bin/csh -x
read the man page of csh to se what '-x' exactly means.
then make sure you run the script directly, and not via
'csh scriptname'. if you use the later optin, run it as:
'csh -x scriptname'
hope this helps,
guy