Re: ctrl-l in bash

From: Dances With Crows (danSPANceswitTRAPhcrows_at_usa.net)
Date: 10/05/03


Date: 5 Oct 2003 20:19:42 GMT

On Sun, 05 Oct 2003 16:03:42 -0400, Silviu Minut staggered into the
Black Sun and said:
> How do I echo ctrl-l in bash?

echo "^V^L"

(Remember, ^V means "Ctrl-V". ^V followed by any character will insert
that character literally, if you haven't changed your default settings
using stty.)

> Or in a C program, for that matter.

putchar('\f');

> looked at the "Advance Bash-scripting Guide" and the examples there
> don't work.

What are you attempting to achieve by echoing ^L to the screen? It
doesn't do much useful that I can see here (konsole 1.2.3, terminal type
"xterm") but maybe there's something I'm missing. If you're trying to
clear the screen, system("clear"); or the appropriate ncurses function
would be a better way of doing that.

-- 
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin /    mail: TRAP + SPAN don't belong
http://www.brainbench.com     /  "He is a rhythmic movement of the
-----------------------------/    penguins, is Tux." --MegaHAL


Relevant Pages

  • Re: HP-UX: ssh connections ignore CTRL+C interrupts
    ... When I ssh from HPUX to another HPUX box and I type 'stty' I get the ... The only way to Ctrl-C working is to start the sshd from an interactive ... stty settings should probably be considered "uninitialized variables". ... The proper way for stty settings to be established is by the client. ...
    (SSH)
  • Re: funny character echo/line discipline behavior in Expect under RH9
    ... It's due to bash. ... it's simply easier than figuring out how to undelete a character. ... up to the next command prompt. ...
    (comp.lang.tcl)
  • Re: bash does not support the @ and # characters
    ... After I type the '#' character on bash, the cursor backspace one ... After I type the '@' character on bash, the cursor goes back to the ... Try 'stty sane' or explicitly mapping them with stty erase ^? ...
    (comp.unix.solaris)
  • Re: umask
    ... but it only works for the bash settings. ... Christian Ruffer schrieb: ... i want to change the default umask permanently for one user. ...
    (Debian-User)
  • Re: Fedora, XTerm and backspace
    ... in fact the settings for erase are different. ... fathom why or where stty is set, so I just added a line to /etc/bashrc to ... Trog Woolley | trog at trogwoolley dot com ...
    (linux.redhat)