Date: Thu, 28 Jun 2001 15:34:02 +0200 From: Stijn Hoop <stijn@win.tue.nl> To: j mckitrick <jcm@FreeBSD-uk.eu.org> Cc: freebsd-questions@freebsd.org Subject: Re: exporting TERM from a script Message-ID: <20010628153402.G4658@pcwin002.win.tue.nl> 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 %2B0100 References: <20010628142946.A36955@dogma.freebsd-uk.eu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010628153402.G4658>