Subject: Re: clear screen?
From: [email-masked] ("Wei Ku")

2 Jul 1997 03:14:46 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_01BC868F.0DC52340"
X-Mailer: Microsoft Outlook Express 4.71.0544.0
Original-To: <[email-masked]>
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE Engine V4.71.0544.0
Original-Sender: [email-masked]

This is a multi-part message in MIME format.

------=_NextPart_000_01BC868F.0DC52340
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

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 =3D 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
[email-masked]
---------------------------------------
Solid State Division
Oak Ridge National Laboratory
P.O.Box 2008
Oak Ridge, TN 37831-6032
Phone: (423) 574-5795
Fax: (423) 574-4143
[email-masked]
***************************************

 ----
From: $Bill Luebkert <[email-masked]>
To: [email-masked]
Cc: [email-masked]
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=3D'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=3D'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: [email-masked]
-
For help on using this list (especially unsubscribing), send a message =
to
"[email-masked]" with one line of text: "help".

------=_NextPart_000_01BC868F.0DC52340
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<HTML><META content=3D'"Trident 4.71.0544.0"' name=3DGENERATOR>

</HEAD>
<BODY>
<P><FONT face=3DArial size=3D2><FONT size=3D2>Hello, =
$Bill:</FONT></FONT>

<P><FONT face=3DArial size=3D2><FONT size=3D2>Sorry to say this: the =
second way you=20
mentioned does not work:</FONT></FONT>

<P><FONT face=3DArial size=3D2><FONT size=3D2>&gt; 2) compile this into =
clear.exe or=20
cls.exe:</FONT></FONT><FONT face=3DArial size=3D2><FONT size=3D2><BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #include =
&lt;stdio.h&gt;<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int main () {=20
printf(&quot;033[2J&quot;); }<BR>
<BR>
</FONT></FONT>

<P><FONT face=3DArial size=3D2><FONT size=3D2>Here is an example that =
will work ( use=20
g++ -o cls cls.cpp ):</FONT></FONT>

<P><FONT face=3DArial size=3D2><FONT size=3D2>[cls.cpp]</FONT></FONT>

<P><FONT face=3DArial size=3D2><FONT size=3D2></FONT></FONT><FONT =
face=3DArial=20
size=3D2><FONT size=3D2>#include &lt;iostream.h&gt;<BR>&nbsp;
<BR>
int main () {<BR>
  char a =3D 27u;<BR>
  cout &lt;&lt; a &lt;&lt; &quot;[2J&quot;;<BR>
  return 0;<BR>
}</FONT></FONT>

<P><FONT face=3DArial size=3D2><FONT size=3D2>And I am sure that you can =
figure out=20
several ways to do this in pure C in order to generate a more compact =
binary=20
executable file.</FONT></FONT>

<P><FONT face=3DArial size=3D2><FONT size=3D2>Sincerely,<BR>
Wei Ku<BR>
<BR>
***************************************<BR>
Department of Physics and Astronomy<BR>
The University of Tennessee<BR>
1408 Circle Drive<BR>
Knoxville, Tennessee 37996-1200<BR>
<A =
href=3D"mailto:[email-masked]">[email-masked]</A><BR>=

---------------------------------------<BR>
Solid State Division<BR>
Oak Ridge National Laboratory<BR>
P.O.Box 2008<BR>
Oak Ridge, TN 37831-6032<BR>
Phone: (423) 574-5795<BR>
Fax: (423) 574-4143<BR>
<A =
href=3D"mailto:[email-masked]">[email-masked]</A><BR>=

***************************************<BR>
</FONT>

<P></P>
 ----<BR>
<B>From: </B>$Bill Luebkert &lt;[email-masked]&gt;<BR>
<B>To: </B>[email-masked]<BR>
<B>Cc: </B>[email-masked]<BR>
<B>Date: </B>Tuesday, July 01, 1997 6:47 PM<BR>
<B>Subject: </B>Re: clear screen?<BR>
<BR>
<HTML><BODY><FONT size=3D2>John Cooper wrote:<BR>
&gt;<BR>
&gt; Is there a command to clear the screen when using bash?<BR>
&gt;<BR>
&gt; `type clear' and `type cls' reveal nothing.<BR>
<BR>
Here's three things you can try:<BR>
<BR>
1) alias cls=3D'echo -n=20
^[[2J'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
# the=20
^[ is an esc (in vi I use ^V followed by<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;=20
# ^[ where ^ is holding down the cntrl key)<BR>
<BR>
2) compile this into clear.exe or cls.exe:<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #include &lt;stdio.h&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int main () {=20
printf(&quot;033[2J&quot;); }<BR>
<BR>
3) alias cls=3D'cat ~/.cls'<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where .cls contains just =
these 4=20
chars with no \n or spaces (ESC [ 2 J)<BR>
<BR>
HTH,<BR>
--<BR>
&nbsp; ,-/-&nbsp; __&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _&nbsp;=20
_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Bill Luebkert<BR>
(_/&nbsp;&nbsp; /&nbsp; )&nbsp;&nbsp;&nbsp; //=20
//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DBE Collectibles<BR>
&nbsp; / ) /--&lt;&nbsp; o // //&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A=20
href=3D"http://www.wgn.net/~dbe/">http://www.wgn.net/~dbe/</A><BR>
-/-' /___/_&lt;_&lt;/_&lt;/_&nbsp;&nbsp;&nbsp; Email: <A=20
href=3D"mailto:[email-masked]">[email-masked]</A><BR>
-<BR>
For help on using this list (especially unsubscribing), send a message =
to<BR>
&quot;<A=20
href=3D"mailto:[email-masked]">[email-masked]=
</A>&quot;=20
with one line of text: &quot;help&quot;.<BR>
</FONT></FONT>
</BODY></HTML>

------=_NextPart_000_01BC868F.0DC52340--

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".