As opposed to a "shell-script" or other command which is usually executed as a subprocess.
UNIX-style subprocess execution of commands provides isolation. The parent is unaffected by the child, except for interactions through the filesystem. (Although with the /proc filesystem, or the child applying a debugger to the parent, that could be significant.)
Whereas, consider a csh style source-script. It can be changing directories all over the place to get its work done. And it may terminate with an error before finishing properly. So the "caller" or the source-script may not know what directory he is in after the source script terminates.
Q: how many people do:
set saved_dir=`pwd`
source srcscript.csh
cd $saved_dir
And,of course, even that has obvious bugs.
No comments:
Post a Comment