DASH Shell discussions
 help / color / mirror / Atom feed
From: Alex Waite <alexqw85@gmail.com>
To: dash@vger.kernel.org
Subject: Re: dash and ANSI escape sequences
Date: Tue, 18 Feb 2014 14:27:55 +0100	[thread overview]
Message-ID: <ldvn4d$pi$1@ger.gmane.org> (raw)
In-Reply-To: <20140218131132.GA30525@hal.lan>

On 02/18/2014 02:11 PM, Guido Berhoerster wrote:
>> [snip]
>> Am I somehow missing some hidden functionality in printf, or is
>> there really no POSIX compliant method of printing colors, or is
>> Dash simply incomplete with its POSIX support in this regard?
>
> dash, POSIX, or C89 have nothing to do with colors, it depends on
> your terminal whether it interprets certain escape sequences as
> color attributes.

Ahh. Ok.

> You can print arbitrary bytes in a portable way (i.e. as
> specified by POSIX) by using octal notation, e.g. escape is 033
> in octal:
>
> printf "\033[1;32mpassed\033[0m\n"

Understood; I get how this all fits together now.

Thanks for your example and explanation!

---Alex



  parent reply	other threads:[~2014-02-18 13:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-18 11:54 dash and ANSI escape sequences Alex Waite
2014-02-18 13:11 ` Guido Berhoerster
2014-02-18 13:22   ` Steffen Nurpmeso
2014-02-18 13:27   ` Alex Waite [this message]
2014-02-18 13:16 ` Steffen Nurpmeso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='ldvn4d$pi$1@ger.gmane.org' \
    --to=alexqw85@gmail.com \
    --cc=dash@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox