Path: utzoo!mnetor!uunet!tektronix!tekcrl!terryl
From: terryl@tekcrl.TEK.COM
Newsgroups: comp.unix.questions
Subject: Re: unsetenv TERMCAP in a csh
Message-ID: <2620@tekcrl.TEK.COM>
Date: 8 May 88 20:52:00 GMT
References: <479@cieunix.rpi.edu+ <3780@csli.STANFORD.EDU>
Reply-To: terryl@tekcrl.tek.com
Organization: Tektronix, Inc., Beaverton,  OR.
Lines: 31

In article <3780@csli.STANFORD.EDU+ gandalf@csli.stanford.edu (Juergen Wagner) writes:
+Instead of writing three-line csh scripts of the form
+	#! /bin/csh
+	unsetenv TERMCAP
+	set term = foo
+you could use something like
+	alias foo "unsetenv TERMCAP; set term = foo"

     Yes.....
+Yet, even better:
+	alias term "unsetenv TERMCAP; set term = \!* ; tset"
     Yes.....Yes.....
+which will work for
+	term vt100
+	term tvi950
+	term h19
+	term foo
+	term bar
+(you can guess how it continues). In fact, you can use any terminal
+type in /etc/termcap (Great, isn't it?).
     Yes.....Yes.....Yes.....
+Aliases work much better because they are executed in the current 
+environment, whereas scripts are run in a new shell. ...and there is
+no way to change the parent's environment just bu calling a script.

      One Yes..... & one No.......
      The Yes goes to the comments about aliases, the No to shell scripts
(with a caveat). If you call a shell script by name, then yes, there is no
way to change the parent's environment; IF, however, you say "source " (no quotes) then the parent's environment will be changed (use .
 if you use the Bourne Shell).