fronthem
fronthem

Reputation: 4139

Print zero width and height character in bash

In normal case:

$ echo ""

$ 

In my expectation:

$ echo [something]
$

I just want to know that is there anyway I can print some text that have zero width and height. This question is not limit only echo command but any equivalent commands also can be considered.

Upvotes: 0

Views: 175

Answers (1)

Ulrich Schwarz
Ulrich Schwarz

Reputation: 7727

What you're seeing is the newline added by echo unless you tell it not to with the -n option:

[0 1003 7:24:01] ~ % echo -n ''
[0 1004 7:24:03] ~ % echo ''

[0 1005 7:24:08] ~ % 

But in general terms, keep in mind that terminal output deals with fixed-width characters, so there's no "zero height and width". Closest you can do (sometimes) is put the cursor back where you started out so that new text will overwrite your old.

Upvotes: 1

Related Questions