From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1633 invoked from network); 27 Aug 2001 08:07:26 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 27 Aug 2001 08:07:26 -0000 Received: (qmail 29778 invoked by alias); 27 Aug 2001 08:07:07 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4169 Received: (qmail 29766 invoked from network); 27 Aug 2001 08:07:05 -0000 From: Bart Schaefer Message-Id: <1010827080644.ZM32436@candle.brasslantern.com> Date: Mon, 27 Aug 2001 08:06:44 +0000 In-Reply-To: <20010827004932.A11967@panix.com> Comments: In reply to Russell Hoover "prompt quoting question" (Aug 27, 12:49am) References: <20010827004932.A11967@panix.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Russell Hoover , zsh-users@sunsite.dk Subject: Re: prompt quoting question MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 27, 12:49am, Russell Hoover wrote: } } 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. Backticks within single quotes are not recognized as quotes. Quotation forms normally do not nest. There are two exceptions, and both apply only when the outermost quotes are double quotes: 1. Inside "$(...)", all forms of quoting may appear within the parens. 2. Inside "${...}", balanced double quotes may appear within the braces. The possible solutions are: a. Use double quotes (or none at all) around the argument to sed. RPS1=$'...`/usr/bin/tty | sed -e s@/dev/tty@@`...' b. End the $'...' expression before you begin some other quoting. RPS1=$'...''`/usr/bin/tty | sed -e s@/dev/tty@@`'$'...' Neither helps in cases where the nesting quotes can't be eliminated by other trickery; (b) might be simpler in some circumstances, but not in this case. For this particular question, though, I think the best solution is: c. Use the %l or %y prompt escape instead of that sed command. RPS1=$'%{\e[1;34m%} %l %{\e[1;32m%}%D{%A %Y/%m/%d %T} %{\e[m%}' -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net