bug-sh-utils
[Top][All Lists]
Advanced

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

RE: Two bash programming questions (fwd)


From: Michael Schwendt
Subject: RE: Two bash programming questions (fwd)
Date: Wed, 6 Jun 2001 23:29:46 +0200 (CEST)

Hi!

$ rpm -qf `which echo`
sh-utils-2.0-13

$ cat /etc/redhat-release
Red Hat Linux release 7.1 (Seawolf)

Is it correct behaviour for "echo" that

  echo -en "\\\b"

prints out "\b" instead of a "\" which is erased by the subsequent
backspace immediately?

On the contrary, both

  echo -en "\\"

and

  echo -en "\b\\"

print out a backslash correctly.

---------- Forwarded message ----------
Date: Wed, 6 Jun 2001 23:24:58 +0200 (CEST)
From: Michael Schwendt <address@hidden>
To: "'address@hidden'" <address@hidden>
Subject: RE: Two bash programming questions

On 2001-06-06, Taylor, ForrestX wrote:

>> echo with "-e".
>
>
>That's what I have.  From the original post:
>>   [ $C == 0 ] && echo -e -n "\b\\"
>What I want is something like:
>   [ $C == 0 ] && echo -e -n "\\\b"
>
>a \ followed by a backspace.  This prints out \b.

Split it:

  echo -en "\\" ; echo -en "\b"

Whether it's a bug, I don't know.

Notice, however, that a \b after a character erases that one
immediately. Doesn't look as nice as erasing the last char before
printing a new one.






reply via email to

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