Petr Slechta wrote:
> Roland Mainz wrote:
> > Petr Slechta wrote:
> >> Paul Cunningham wrote:
> >>> See my comments from my quick skip through below ...
> >>> Petr Slechta wrote:
[snip]
> >> and should I replace ". ${SRC}/tools/install.subr" with "source
> >> ${SRC}/tools/install.subr""even if other scripts in SFW repository use
> >> the "." convention? (I believe that "." and "source" behave exactly the
> >> same...)
> >
> > No, they are not exactly the same. In ksh93 "source" is an alias for
> > "command ." which allows a script to trap an error if the scriptlet
> > which should be included cannot be accessed instead of just exiting (the
> > standard requires that if "." fails to read/execute the scriptlet the
> > shell has to exit immediately - the extra "command" in front of "."
> > allows the shell to continue ("command" just returns a non-zero exit
> > code which the "errexit" mode will then catch)). The idea in this case
> > is that the shell (in "errexit" mode) produces a more descriptive error
> > message than just exit (the same applies to "bash").
> >
> OK, I see. I just wonder, is not it regular error if script cannot
> include some file? (So should not it fail in case that the file which
> should be included is not there?)

No, it's treated as a parsing error and the whole script interpreter
takes a shortcut to hell. That's why David Korn invented the "source"
thing to catch these errors in a more friendly way (or use FPATH to load
functions) ...

> But anyway, I can change it the way you propose and test it...

Thanks! :-)

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

Reply via email to