unsetenv TERMCAP in a csh

terryl at tekcrl.TEK.COM terryl at tekcrl.TEK.COM
Mon May 9 06:52:00 AEST 1988


In article <3780 at csli.STANFORD.EDU+ gandalf at 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 <script-
name>" (no quotes) then the parent's environment will be changed (use .
<script-name> if you use the Bourne Shell).



More information about the Comp.unix.questions mailing list