From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18334 invoked from network); 13 Feb 2009 04:10:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 13 Feb 2009 04:10:24 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 43333 invoked from network); 13 Feb 2009 04:10:14 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Feb 2009 04:10:14 -0000 Received: (qmail 84 invoked by alias); 13 Feb 2009 04:09:55 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13835 Received: (qmail 72 invoked from network); 13 Feb 2009 04:09:55 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 13 Feb 2009 04:09:55 -0000 Received: from deliverator5.ecc.gatech.edu (deliverator5.ecc.gatech.edu [130.207.185.175]) by bifrost.dotsrc.org (Postfix) with ESMTPS id DD13980271F0 for ; Fri, 13 Feb 2009 05:09:36 +0100 (CET) Received: from deliverator5.ecc.gatech.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 3581D180160 for ; Thu, 12 Feb 2009 23:09:34 -0500 (EST) Received: from mail7.gatech.edu (bigip.ecc.gatech.edu [130.207.185.140]) by deliverator5.ecc.gatech.edu (Postfix) with ESMTP id E00A9180136 for ; Thu, 12 Feb 2009 23:09:33 -0500 (EST) Received: from [128.61.81.101] (bigip.ecc.gatech.edu [130.207.185.140]) by mail7.gatech.edu (Postfix) with ESMTP id CE8A22C8970 for ; Thu, 12 Feb 2009 23:09:33 -0500 (EST) Message-ID: <4994F27D.7080207@gatech.edu> Date: Thu, 12 Feb 2009 23:09:33 -0500 From: Matthew Flaschen User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: zsh-users@sunsite.dk Subject: Re: /usr/bin/printf References: <4994CFCF.2090408@gatech.edu> <237967ef0902121751k37dd810co312238682d9b60f0@mail.gmail.com> <4994E32E.2050508@gatech.edu> <090212192523.ZM11726@torch.brasslantern.com> In-Reply-To: <090212192523.ZM11726@torch.brasslantern.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.92.1/8985/Thu Feb 12 23:11:57 2009 on bifrost X-Virus-Status: Clean Bart Schaefer wrote: > The (q) tells zsh to insert a backslash before any special characters > that appear in the value of $1, including the backslash in "\n". Then > "print" strips the extra backslashes off again and the final output is > the original string. > > Or, well, it would be, except there's that -P option there, which will > turn any %x (for any x) in your $1 into some sort of prompt expando. > So you really need to do this in two steps, one to do the prompt > expansion and one to handle the value of $1. Okay, that makes sense. > preexec () { print -Pn "\e]0;%n@%m: "; print -n "${(q)1}\a" } It works great. Thanks. Matt Flaschen