zsh-users
 help / color / mirror / code / Atom feed
From: Russell Hoover <rj@panix.com>
To: zsh-users@sunsite.dk
Subject: prompt quoting question
Date: Mon, 27 Aug 2001 00:49:32 -0400	[thread overview]
Message-ID: <20010827004932.A11967@panix.com> (raw)

I have a right-prompt string:

export RPS1="%{$(print -n '\e[1;34m')%} `/usr/bin/tty | sed -e 's/\/dev\/tty//'`  \
%{$(print -n '\e[1;32m')%}%D{%A  %Y/%m/%d  %T} %{$(print -n '\e[m')%}"

which works fine, creating:

                                     r8  Monday  2001/08/27  00:29:49


where the tty (r8) is blue and the rest is green.  But this is the old style
of creating colors.  With the new, I know I need something like:

export RPS1=$'%{\e[1;34m%} tty  %{\e[1;32m%}%D{%A  %Y/%m/%d  %T} %{\e[m%}'

But when I replace "tty" in the line above with `/usr/bin/tty | sed -e 's/\/dev\/tty//'`
instead of displaying the tty number, the prompt is messed up:

                 \e[1;32mMonday  2001/08/27  00:14:45 \e[mv

and sed gives me an error message:

                 sed: 1: "s//dev/tty//": bad flag in substitute command: 't'

It seems to me the problem is in correctly quoting the 's/\/dev\/tty//' : the
single quotes (within backtics within single quotes) won't cut it.  Any clues
appreciated.

-- 
                                 // rj@panix.com //


             reply	other threads:[~2001-08-27  4:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-27  4:49 Russell Hoover [this message]
2001-08-27  7:50 ` Preben Guldberg
2001-08-27  8:06 ` Bart Schaefer

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=20010827004932.A11967@panix.com \
    --to=rj@panix.com \
    --cc=zsh-users@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).