Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!uwmcsd1!marque!uunet!munnari!vuwcomp!dsiramd!csnz!paul From: paul@csnz.nz (Paul Gillingwater) Newsgroups: comp.unix.xenix Subject: Changing the environment in sh Summary: How do you export out of a shell script? Keywords: sh export shell Message-ID: <59@csnz.nz> Date: 2 Sep 88 11:19:10 GMT Reply-To: paul@csnz.UUCP (Paul Gillingwater) Organization: Computer Sciences of New Zealand, Wellington, NZ Lines: 27 I've Read The FM's, but I must be a bit dim - how do I change an environment variable, e.g. PATH, using a /bin/sh script, and have those changes effective in my login shell? I tried setting the PATH and exporting it within the shell script, and the environment for the shell that was executing the script changed (as one would expect), but when that shell had finished, my login shell environment was unchanged. Basically I'm running two versions of the same software, so I put them in different subdirectories, and I wanted to update my PATH and other shell variables to reflect that. I tried creating two versions of my .profile, V3.profile and V4.profile, then copying the appropriate one over my .profile in my home directory, and then did a . .profile in the shell script. What am I doing wrong? If I do the . .profile from the keyboard, it works fine; from a shell it forgets the PATH, even with an export PATH immediately following the . .profile. Thanks for any help..... -- Paul Gillingwater, Computer Sciences Call this BBS - Magic Tower (24 hours) paul@csnz.nz (vuwcomp!dsiramd!csnz) NZ +64 4 753 561 8N1 TowerNet software P.O.Box 929, Wellington, NEW ZEALAND V21/V23/V22/V22bis/Bell 103/Bell 212A Vox: +64 4 846194, Fax: +64 4 843924 "All things must parse"-ancient proverb