All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: dash@vger.kernel.org
Subject: Re: Dash quoting bug?
Date: Fri, 30 Nov 2007 09:33:31 -0500	[thread overview]
Message-ID: <47501F3B.8030208@sunshineco.com> (raw)
In-Reply-To: <20071130002328.GH23769@gondor.apana.org.au>

Herbert Xu wrote:
> On Thu, Nov 29, 2007 at 08:32:55AM -0500, Eric Sunshine wrote:
>> According to the dash manual, within single quotes, all characters are 
>> treated as literals (except single quote), which appears to agree with 
>> POSIX, so the above behavior seems incorrect.
> We need a patch for the dash manual :)
> Unfortunately according to POSIX we must interpret these escape sequences:
> 12682 SYNOPSIS
> 12683   echo [string ...]
> 12695     The following character sequences shall be recognized
> 12696     within any of the arguments:
> 12703       \n        Write a <newline>.

Thank you for the response and for pointing out this documentation.

> I suggest that you switch over printf for portability.  That is,
> replace all occurances of
> 	echo "string"
> with
> 	printf "%s\n" "string

Unfortunately, in this case, a portability requirement to older 
platforms lacking 'printf' negates the viability of such a solution. As 
it turns out, however, I was able to resolve the issue by eliminating 
the need to emit backslashes, thus altogether side-stepping the problem.

-- ES


      reply	other threads:[~2007-11-30 14:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <474EBF87.3040103@sunshineco.com>
2007-11-30  0:23 ` Dash quoting bug? Herbert Xu
2007-11-30 14:33   ` Eric Sunshine [this message]

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=47501F3B.8030208@sunshineco.com \
    --to=sunshine@sunshineco.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.