[ksh93-integration-discuss] about debug options in ksh

David Korn dgk at research.att.com
Mon May 7 07:35:58 PDT 2007


cc:  Paul.Guo at sun.com
Subject: Re: Re: [ksh93-integration-discuss] about debug options in ksh
--------

> Felix Schulte wrote:
> > On 4/25/07, paul.guo <Paul.Guo at sun.com> wrote:
> > > I have two questions about ksh, and since I am not in the alias, please
> > > add my
> > > email address when replying.
> > >
> > > 1. I am using ksh88, and found 'set -x' and 'set -v' do not work on
> > > sub-functions.
> > > Is ksh93 still like that ? Why don't allow these options in
> > > sub-functions?
> > >
> > > 2. If you write scripts in shell languages, you must be very careful to
> > > prevent
> > > the typo. shell almost does not provide any options to prevent typo.
> > ksh93 has a script compiler which compiles shell scripts into a binary
> > and does some error checking during the compilation
> 
> I am not sure but AFAIK "shcomp" only does basic syntax checking and not
> what Paul was looking for...
> 
> ----
> 
> Bye,
> Roland
> 

Yes, shcomp does not check variable references.  Use set -o nounset
or set -u for this.  This option will also check for referencing
associative array subscripts that haven't been set, for example
	set -o nounset
	typeset -A array
	array[foo]=bar
	print ${array[food]}
would produce an error.

David Korn
dgk at research.att.com



More information about the ksh93-integration-discuss mailing list