From owner-freebsd-questions Thu Jun 28 20:57:54 2001 Delivered-To: freebsd-questions@freebsd.org Received: from smtprelay2.adelphia.net (smtprelay2.adelphia.net [64.8.25.7]) by hub.freebsd.org (Postfix) with ESMTP id 8B47637B405 for ; Thu, 28 Jun 2001 20:57:50 -0700 (PDT) (envelope-from ipthomas_77@yahoo.com) Received: from scraemondaemon.my.domain ([24.49.96.3]) by smtprelay2.adelphia.net (Netscape Messaging Server 4.15) with ESMTP id GFOB0W02.R6S; Thu, 28 Jun 2001 23:58:08 -0400 Received: (from ipt@localhost) by scraemondaemon.my.domain (8.9.3/8.9.3) id XAA04190; Thu, 28 Jun 2001 23:56:19 -0400 (EDT) (envelope-from ipt) From: "Ian P. Thomas" Message-Id: <200106290356.XAA04190@scraemondaemon.my.domain> Subject: Re: How to have a script set an environment variable To: jim@freeze.org (Jim Freeze) Date: Thu, 28 Jun 2001 23:56:19 -0400 (EDT) Cc: freebsd-questions@freebsd.org In-Reply-To: from "Jim Freeze" at Jun 28, 2001 09:24:11 AM X-Mailer: ELM [version 2.5 PL5] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 What about #!/usr/local/tcsh set terminal = `tty` if ($terminal == /dev/your_terminal) then setenv TEST "test" end unset terminal and in .logout unsetenv TEST I have read people's opinions on writing cshell scripts, but I havn't run into any problems with them. Or maybe this doesn't help at all. Ian In the last episode, Jim Freeze stated... > > Hi: > > I don't know if this can be done, but I am would like > to write a script that would set an environment variable > for a particular terminal window. > > I am running tcsh. If I write a script such as: > #! /bin/sh > set TEST "test" > export TEST > > TEST is set for the script, but not for the parent > terminal. Is there a switch I can send to /bin/sh > to use the parent's environment? > > Thanks > > > ========================================================= > Jim Freeze > jim@freeze.org > --------------------------------------------------------- > No comment at this time. > http://www.freeze.org > ========================================================= > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message