change environment variable via script

Alex Dean alex at crackpot.org
Fri Dec 23 12:58:31 MST 2005


On Dec 23, 2005, at 11:00 AM, Victor Odhner wrote:

> Be careful not to put an "exit" in the "dotted" script, since that  
> will end your session.

I realized that the first time I ran it.  My terminal quit. :)  I  
haven't looked into this, but I imagine shell  functions support some  
kind of 'return' value instead of 'exit'?

On Dec 23, 2005, at 11:04 AM, Eric Shubes wrote:
> Alternatively, you could have done:
> $ . ./cvsswitch two
>
> Notice the '. ' before the command, which executes the command in  
> the current shell without starting a new one.

Thanks to all who have responded.  The programming isn't hard, but  
the shell environment is a little different from things I'm used to  
developing (web apps w/ PHP mostly).  It underscores the fact that  
understanding the context a program will run in is critical.

alex
.





More information about the PLUG-discuss mailing list