Jay Taylor's notes
back to listing indexHow to delete line with echo?
[web search]
I know that I could delete the last three chars with:
But how can I delete a full line? I mean I dont want to use:
...etc... to delete a long line..
|
|||||||||||||||
|
|||||||||||||||
You can use Example: both
and
will print:
If you want the characters deleted then you have to use the following workaround:
output:
Excerpt from
|
|||||||||||||||||||||
|
You're looking for terminal escapes. In particular, to clear from the cursor position to the beginning of the line:
Or everything on the line, regardless of cursor position:
And you can do all sorts of other neat tricks with terminal escapes too.
|
|||||||||||||||||||||
|
If you want to clear the line, then I suggest you use a combination of the carriage return people are mentioning and terminfo.
This will write
|
|||||||||
|
You explicitly ask for
|
|||||||||||||||
|
Technology | Life / Arts | Culture / Recreation | Science | Other | ||
---|---|---|---|---|---|---|
This site is not affiliated with Linus Torvalds or The Open Group in any way.