Changing the environment in sh

Dave Hammond daveh at marob.MASA.COM
Sun Sep 4 07:45:02 AEST 1988


In article <59 at csnz.nz> paul at csnz.UUCP (Paul Gillingwater) writes:
>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?

Instead of having the shell execute the script, as in

$ sh script
(or)
$ script          # assuming script is chmod +x

have the shell evaluate, or source the script:

$ . script        # `dot script'

Dave Hammond
  UUCP: {uunet|...}!marob.masa.com!!daveh
DOMAIN: daveh at marob.masa.com
------------------------------------------------------------------------------



More information about the Comp.unix.xenix mailing list