help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How Bash echo line start from previous line


From: Greg Wooledge
Subject: Re: How Bash echo line start from previous line
Date: Mon, 21 Aug 2023 07:12:29 -0400

On Mon, Aug 21, 2023 at 05:24:51PM +0700, Budi wrote:
> How can Bash echo line start from previous line above created by a
> simple echo i.e. not echo -n

Use printf instead.

printf 'foo: '
sleep 3
echo 'done'

Once you've already *written* a newline to the terminal, it's too late.
You can't take it back.  So you need to *avoid* sending the newline
in the first place.  You do that by using printf, which is the sensible
replacement for the obsolete and glitchy "echo -n".



reply via email to

[Prev in Thread] Current Thread [Next in Thread]