David, Use the "source" command to process the script so that its variable-setting side-effects occur in your shell. Otherwise those variable settings happen in a sub-shell (and for exported variables, any processes it invokes). The "source" command has a synonym: "."
% help source source: source filename Read and execute commands from FILENAME and return. The pathnames in $PATH are used to find the directory containing FILENAME. Randall Schulz Mountain View, CA USA At 19:20 2002-10-12, David Ryan wrote: >I have very simple script that all it needs to do is export some >environment variables. I can't seem to get it to work. All it does is.. > >export PS2DEV=/usr/ps2dev > >If I do this on the command line it works fine.. and if I place it in >/etc/profile it works also. I assume whats happenning is its starting a >shell.. setting the environment variable and then closing the shell. How >do I write a script that modifies the current environment? > >If I can get the one line working I'll be expanding it, so doing it on the >command line everytime is not an option. > >I have the cygwin 1.3.12-4 installed. I also tried going back to 1.3.10-1 >to see if it was a bug. I'm hoping theres something small I'm missing. > >Thanks, >David. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/