From owner-freebsd-questions Thu Jun 28 7:44:46 2001 Delivered-To: freebsd-questions@freebsd.org Received: from pcwin002.win.tue.nl (pcwin002.win.tue.nl [131.155.71.72]) by hub.freebsd.org (Postfix) with ESMTP id 1F5D937B403 for ; Thu, 28 Jun 2001 07:44:42 -0700 (PDT) (envelope-from stijn@pcwin002.win.tue.nl) Received: (from stijn@localhost) by pcwin002.win.tue.nl (8.11.4/8.11.4) id f5SEh7I70293; Thu, 28 Jun 2001 16:43:07 +0200 (CEST) (envelope-from stijn) Date: Thu, 28 Jun 2001 16:43:07 +0200 From: Stijn Hoop To: Jim Freeze Cc: Alex Dyas , j mckitrick , freebsd-questions@freebsd.org Subject: Re: exporting TERM from a script Message-ID: <20010628164307.I4658@pcwin002.win.tue.nl> References: <911D8F660DF6D411B61F00500462BA01B08470@exchange.twowaytv.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from jim@freeze.org on Thu, Jun 28, 2001 at 10:33:01AM -0400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Jun 28, 2001 at 10:33:01AM -0400, Jim Freeze wrote: > On Thu, 28 Jun 2001, Alex Dyas wrote: > > > > Try running the script thus: > > > > $ . ./gonet > > > Hmmm, I get > > $ . ./myscript.sh > .: Permission denied. > > Where as > $ ./myscript.sh > > runs fine, just no changing of the parents env. Works here: $ echo $TEST $ ls -l bla.sh -rw-r--r-- 1 stijn stijn 32 Jun 28 16:39 bla.sh $ cat bla.sh TEST=test; export TEST echo dsa $ . bla.sh dsa $ echo $TEST test but only in sh - use 'source' for csh/tcsh (and make sure your script is written in the syntax for those shells!) As to why this works, that's because this command executes all commands listed in the file as if you had typed them in; that is, it doesn't spawn a subshell. So, you modify your login shell's environment (which is what you wanted). Thank you Alex for the suggestion - I didn't think of it before. --Stijn -- Tact, n.: The unsaid part of what you're thinking. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message