From owner-freebsd-questions Thu Jun 28 6:35:33 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 E9E2D37B403 for ; Thu, 28 Jun 2001 06:35:29 -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 f5SDY2x69762; Thu, 28 Jun 2001 15:34:02 +0200 (CEST) (envelope-from stijn) Date: Thu, 28 Jun 2001 15:34:02 +0200 From: Stijn Hoop To: j mckitrick Cc: freebsd-questions@freebsd.org Subject: Re: exporting TERM from a script Message-ID: <20010628153402.G4658@pcwin002.win.tue.nl> References: <20010628142946.A36955@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010628142946.A36955@dogma.freebsd-uk.eu.org>; from jcm@FreeBSD-uk.eu.org on Thu, Jun 28, 2001 at 02:29:47PM +0100 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 02:29:47PM +0100, j mckitrick wrote: > Here is a very simple script for changing my TERM setting manually. Why > doesn't it work? Inside the script, TERM has the value 'cons25,' but when > it exits, it goes back to vt100 or xterm-color. Shouldn't export fix this? > I've used TERM in my shell startup and exported it after setting it, and it > works fine. I can also change it manually from the console, and it works > fine. It is just this file. > > Jonathon > -- > Microsoft complaining about the source license used by > Linux is like the event horizon calling the kettle black. > #!/bin/sh > > echo "gonet!" > cat ~/.mutt/.mutt0 ~/.mutt/.mutt2 > ~/.muttrc > TERM=cons25;export TERM > echo $TERM As far as I understood environment variables, there is no way to modify your parent's environment. The only thing export does is that the variable you set is inherited by all children of your script. Since the script is a child of your shell itself (assuming you run it with ./script or similar), it can't modify your shell's environment. Use startup scripts to export TERM behaviour, conditional on being network logged in, $DISPLAY or something like that. If you like to switch between $TERM's (why?), use aliases or shell functions. --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