[Coco] Major OS-9 discovery to enhance script file use.

Boisy Pitre boisy at boisypitre.com
Sun Jan 8 14:15:29 EST 2006


On Jan 8, 2006, at 12:25 PM, tim lindner wrote:

> Robert Gault <robert.gault at worldnet.att.net> wrote:
>
>> (chd /h0/MVUE)</1
>
> I tested something like this on stock OS9 Level 2. I modified the
> startup file to have this at the end:
>
> (chd sys) </1
> echo Success!
>
> After it was done I got my prompt and did a PWD, and found my current
> directory really was /DD/SYS. But the echo command did not execute.
>
> When shell runs the startup file (or any script) it forks a sub shell,
> changing directories in that sub-shell will not effect the parent  
> shell.
> Period.

That is almost correct.  What SysGo does is fork the following:

shell startup -p

Once that process has completed, it then forks the following:

shell

Those two shells live at different times and thus have different  
environments (working directory, etc.)  Changes to one do not affect  
changes to the other.

There is a way to get what people seem to want (having what is in the  
startup file affect the interactive shell).  The last line of startup  
could be:

r=</1

This is a shellplus feature, and redirects chosen I/O paths to  
specific devices.

> What you have found is a way to crash the sub shell, and exeucte  
> the CHD
> command in the parent shells process. I think it crashes becuase  
> you are
> trying to redirect the STDIN of a built in shell command.
>
>> (display 1b 21)</1
>
> This works becuase you dup STDOUT and assign it to STDIN. This works
> around a bug in Select when STDIN is an RBF path. Note, this does not
> crash the sub-shell.
>
> -- 
> tim lindner
> tlindner at ix.netcom.com                                             
> Bright
>
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco



More information about the Coco mailing list