clear screen?
Wei Ku
weiku@UTKUX1.UTK.EDU
Tue Jul 1 23:24:00 GMT 1997
Hello, $Bill:
Sorry to say this: the second way you
mentioned does not work:
> 2) compile this into clear.exe or
cls.exe:
> ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ #include <stdio.h>
> ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ int main () {
printf("033[2J"); }
Here is an example that will work ( use
g++ -o cls cls.cpp ):
[cls.cpp]
#include <iostream.h> ÃÂ
int main () {
char a = 27u;
cout << a << "[2J";
return 0;
}
And I am sure that you can figure out
several ways to do this in pure C in order to generate a more compact binary
executable file.
Sincerely,
Wei Ku
***************************************
Department of Physics and Astronomy
The University of Tennessee
1408 Circle Drive
Knoxville, Tennessee 37996-1200
weiku@utkux.utcc.utk.edu
---------------------------------------
Solid State Division
Oak Ridge National Laboratory
P.O.Box 2008
Oak Ridge, TN 37831-6032
Phone: (423) 574-5795
Fax: (423) 574-4143
weiku@solid.ssd.ornl.gov
***************************************
----
From: $Bill Luebkert <dbe@wgn.net>
To: john.cooper@digitivity.com
Cc: GNU-Win32@cygnus.com
Date: Tuesday, July 01, 1997 6:47 PM
Subject: Re: clear screen?
John Cooper wrote:
>
> Is there a command to clear the screen when using bash?
>
> `type clear' and `type cls' reveal nothing.
Here's three things you can try:
1) alias cls='echo -n
^[[2J'ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ # the
^[ is an esc (in vi I use ^V followed by
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
# ^[ where ^ is holding down the cntrl key)
2) compile this into clear.exe or cls.exe:
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ #include <stdio.h>
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ int main () {
printf("033[2J"); }
3) alias cls='cat ~/.cls'
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ where .cls contains just these 4
chars with no \n or spaces (ESC [ 2 J)
HTH,
--
ÃÂ ,-/-ÃÂ __ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ _ÃÂ
_ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ $Bill Luebkert
(_/ÃÂ ÃÂ /ÃÂ )ÃÂ ÃÂ ÃÂ //
//ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ DBE Collectibles
ÃÂ / ) /--<ÃÂ o // //ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ http://www.wgn.net/~dbe/
-/-' /___/_<_</_</_ÃÂ ÃÂ ÃÂ Email: dbe@wgn.net
-
For help on using this list (especially unsubscribing), send a message to
" gnu-win32-request@cygnus.com "
with one line of text: "help".
More information about the Cygwin
mailing list