Path: utzoo!attcan!uunet!mcvax!hp4nl!philmds!leo From: leo@philmds.UUCP (Leo de Wit) Newsgroups: comp.unix.questions Subject: Re: clearing the terminal screen Keywords: setenv clear vt100 Message-ID: <891@philmds.UUCP> Date: 16 Dec 88 12:11:16 GMT References: <7007@batcomputer.tn.cornell.edu> Reply-To: leo@philmds.UUCP (Leo de Wit) Distribution: comp Organization: Philips I&E DTS Eindhoven Lines: 44 In article <7007@batcomputer.tn.cornell.edu> lynch@batcomputer.tn.cornell.edu (Tim Lynch) writes: | |I'm having a problem setting an environmental variable to speed up |screen clearing. If I'm working from a hp terminal the following works: | | % setenv CLEAR `clear` | % echo $CLEAR # (and the screen is cleared) | |But, if I'm working from a vt100, issuing echo $CLEAR does nothing. Neither does it in my environment; CLEAR appears to be an empty string. This has possibly something to do with the special treatment of the escape character (which is part of the sequence output by clear) by the Cshell; the following worked fine in the Bourne shell: $ CLEAR=`clear` $ echo $CLEAR |Furthermore, echo $CLEAR | wc shows that CLEAR is of length zero. |The terminfo for the vt100 appears ok because I can issue: | | % clear | |and the vt100 screen clears! Actually, I don't have to change terminals; |if I have TERM set to hp, then CLEAR is set to the correct escape sequence |to clear the screen, whereas if TERM is set to vt100, CLEAR is not set |to anything. I've tried this on two different Unix machines. | |Anybody have a clue as to why I can't set CLEAR when TERM is equal to |vt100? The following works in the Cshell: % set CLEAR="`clear`" % alias cls 'echo "$CLEAR"' and now you can do % cls to clear your terminal screen (only from the inside 8-). The double quotes prevent the Cshell from interpreting characters within the string. Hope this clears things a bit 8-). Leo.