Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Interesting zsh behaviour regarding awk and backslash
- X-seq: zsh-users 16451
- From: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Interesting zsh behaviour regarding awk and backslash
- Date: Tue, 27 Sep 2011 19:11:34 +0100
- Cc: Zsh Users <zsh-users@xxxxxxx>, Ismail Donmez <ismail@xxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.fr; s=s1024; t=1317147096; bh=/fFPkhZckyXDlozslB8ErfOfEAWB/ayQvPCHLFoXK9c=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; b=oo5kCQCb8XUeWM8c/e+Hk6N2qXyYAN/DuoVQ9kvkR5l3luRcuUOpQ9hCBz5McI3gXxRVcdi921ZDOVDBcgy6T1eqX4D0WBLtihilbv6QWQRralR5jAqt12rKbbACvyGZdW/3OiThtYfJ+sliommHy0ammXWJKyTg6NVD73EztoI=
- In-reply-to: <110927064822.ZM25007@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>, Ismail Donmez <ismail@xxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAJR5sYhgXzUiGn_BGHiULrqH_VZtxhNFFBVEc=F-tq5D+OZ74g@mail.gmail.com> <CAFOazANa=wPfZteUr4N3W3gQSr8gRMNSEUsXjrAAMitz3+Xm8g@mail.gmail.com> <110927064822.ZM25007@torch.brasslantern.com>
2011-09-27 06:48:22 -0700, Bart Schaefer:
> On Sep 27, 1:54pm, Jeremie Roquet wrote:
> }
> } Why bother with gawk?
> }
> } bash$ echo '\\'
> } \\
> } zsh$ echo '\\'
> } \
>
> This isn't quoting behavior, it's "echo" behavior. If you tell zsh to
> act like a standard shell, it does:
>
> % ARGV0=sh zsh -f
> $ echo '\\'
> \\
> $ set -o | grep echo
> nobsdecho off
> $
standard shells *are meant* to output "\", not "\\". bash is not
standard in that regard. So zsh should *not* change its behavior
when called as sh here.
UNIX (POSIX+XSI) mandates the "\", POSIX makes the behavior of
echo unspecified in that case ("\", "\\" and "ambiguous input"
outputs are all acceptable, echo shouldn't be used in POSIX
scripts where the arguments may contain "\" or start with "-n"
(use printf instead))
zsh is not POSIX (and same for bash) in that it doesn't
output "-e" when called as "echo -e".
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html
for the spec.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author