zsh-workers
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: Roman Perepelitsa <roman.perepelitsa@gmail.com>
Cc: "Peter Stephenson" <p.stephenson@samsung.com>,
	"Zsh hackers list" <zsh-workers@zsh.org>,
	"joão marcos pereira bezerra" <marcospb19@hotmail.com>
Subject: Re: Issue with string slices
Date: Tue, 18 Jun 2019 19:12:00 +0100	[thread overview]
Message-ID: <20190618181200.xrvhk7iheaij65dk@chaz.gmail.com> (raw)
In-Reply-To: <CAN=4vMraKuGp0=Rs839sD+BdGhpo6kmpoeL9+kRy4_gOJ53-wA@mail.gmail.com>

2019-06-17 11:05:32 +0200, Roman Perepelitsa:
> To print $something as is, use one of these forms:
> 
>   echo -nE - "$something"
>   print -nr -- "$something"
>   printf '%s' "$something"
> 
> The first two are ZSH specific, the last is portable. ZSH also allows
> you to omit quotes here unless SH_WORD_SPLIT option is set.
[...]

The second one comes from ksh, it's not zsh-specific and
predates POSIX, let alone POSIX's printf, but nowadays is not as
portable as printf.

If you want to target zsh and ksh only, "print" may be more
desirable as there are still some pdksh derivatives where printf
is not built-in.

"unless SH_WORD_SPLIT *or GLOB_SUBST* is set"

-- 
Stephane

      parent reply	other threads:[~2019-06-19  8:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190617083759epcas1p11383850c11184f54e3a0b822c9ea12e6@epcas1p1.samsung.com>
2019-06-17  8:36 ` joão marcos pereira bezerra
2019-06-17  8:51   ` Peter Stephenson
2019-06-17  9:05     ` Roman Perepelitsa
2019-06-17 16:15       ` joão marcos pereira bezerra
2019-06-18 18:12       ` Stephane Chazelas [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=20190618181200.xrvhk7iheaij65dk@chaz.gmail.com \
    --to=stephane.chazelas@gmail.com \
    --cc=marcospb19@hotmail.com \
    --cc=p.stephenson@samsung.com \
    --cc=roman.perepelitsa@gmail.com \
    --cc=zsh-workers@zsh.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).