zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Derek Peschel <dpeschel@eskimo.com>
Cc: zsh-workers@sunsite.dk
Subject: Re: BUG? - 4.0.2 - parameter substitution won't double backslashes in values
Date: Thu, 7 Feb 2002 19:20:38 +0000 (GMT)	[thread overview]
Message-ID: <Pine.BSF.4.40.0202071903330.37987-100000@brasslantern.com> (raw)
In-Reply-To: <20020207051955.A26840@eskimo.eskimo.com>

On Thu, 7 Feb 2002, Derek Peschel wrote:

> But I would still expect some change (a backspace should change to "\b" when
> using "print", or "\b" should change to "\\b" when using "print -r").

Um, no.  With "print" a "\b" changes to backspace; with "print -r", "\b"
remains "\b".  In either case a literal backspace remains a backspace.

If you want to convert backspace and other "control characters" to a
visible representation, you can use the (V) parameter flag:

zsh% bs=$(print -n '\b')
zsh% print ${(V)bs}
^H

Note that the conversion from '\b' to backspace was done by print, and the
conversion from backspace to ^H was done by parameter expansion.  There is
no built-in mechanism to convert from backspace to '\b'.


  reply	other threads:[~2002-02-07 19:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-07  4:39 Derek Peschel
2002-02-07 10:33 ` Peter Stephenson
2002-02-07 13:19   ` Derek Peschel
2002-02-07 19:20     ` Bart Schaefer [this message]
2002-02-07 20:22       ` Derek Peschel
2002-02-07 21:00         ` Bart Schaefer
2002-02-08  9:29           ` Derek Peschel
2002-02-08 21:35             ` Bart Schaefer
2002-02-07 10:44 ` BUG? - 4.0.2 - " Sven Wischnowsky

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=Pine.BSF.4.40.0202071903330.37987-100000@brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=dpeschel@eskimo.com \
    --cc=zsh-workers@sunsite.dk \
    /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).