DASH Shell discussions
 help / color / mirror / Atom feed
From: Stephane CHAZELAS <stephane_chazelas@yahoo.fr>
To: dash@vger.kernel.org
Subject: Re: [PATCH] echo: fix octal escaping with \1...\7
Date: Wed, 26 Oct 2011 07:59:06 +0000 (UTC)	[thread overview]
Message-ID: <slrnjaffea.cpd.stephane.chazelas@spam.is.invalid> (raw)
In-Reply-To: 1319579884-423-1-git-send-email-vapier@gentoo.org

2011-10-25, 17:58(-04), Mike Frysinger:
> POSIX states that octal escape sequences should take the form \0num
> when using echo.

Only with the XSI option (Unix), for POSIX, echo "\whatever" is
unspecified. But as far as I can tell even with XSI, "echo
'\123'" is unspecified as well, so dash is free to do what it
likes here.

> dash however additionally treats \num as an octal
> sequence.  This breaks some packages (like libtool) who attempt to
> use strings with these escape sequences via variables to execute sed
> (since sed ends up getting passed a byte instead of a literal \1).

Given that the result of  

echo "\123" is unspecified, those scripts would not be POSIX and
they are those to be fixed.

-- 
Stephane


  reply	other threads:[~2011-10-26  8:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-25 21:58 [PATCH] echo: fix octal escaping with \1...\7 Mike Frysinger
2011-10-26  7:59 ` Stephane CHAZELAS [this message]
2011-10-31  3:41 ` Herbert Xu
2011-10-31  4:23   ` Mike Frysinger
2011-10-31 13:12     ` Eric Blake
2011-10-31 13:35       ` Paul Gilmartin
2011-10-31 14:03         ` Eric Blake
2011-10-31 14:56         ` Stephane CHAZELAS
2011-10-31 18:07       ` Harald van Dijk
2011-10-31 18:39       ` Mike Frysinger
2011-10-31 18:48         ` Harald van Dijk

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=slrnjaffea.cpd.stephane.chazelas@spam.is.invalid \
    --to=stephane_chazelas@yahoo.fr \
    --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