From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24008 invoked by alias); 7 Dec 2011 07:12:56 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16608 Received: (qmail 27274 invoked from network); 7 Dec 2011 07:12:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.214.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=auUtZ5syoO9usQmHRqoa7zc1spPjtjJY2lp4Q6MrrQA=; b=Qt/ybc50A3RptPsGeDF9HbEZYGf7ON32g9jrXhVlzayH5IjG5irEuB/KdlmLnqdCwg ij645qKahytLabPvB87TVL3E8krmadmaRkxCJLsdr1EkRl3zUWrvxA7MM/PeEQDfo7Mj P4wibEM2UTKcbglV9t1tiBil4VhSbfXZdpnLM= MIME-Version: 1.0 In-Reply-To: References: <20111207044346.GA6356@primenet.com.au> Date: Wed, 7 Dec 2011 15:04:54 +0800 Message-ID: Subject: Re: Could you provide bash's \$ which like zsh %#? From: Daniel Lin To: Jos Backus Cc: Zsh Users Content-Type: multipart/alternative; boundary=f46d043438983b126004b37b2bd3 --f46d043438983b126004b37b2bd3 Content-Type: text/plain; charset=UTF-8 I got the description on 'man zshmisc' %# A `#' if the shell is running with privileges, a `%' if not. Equivalent to `%(!.#.%%)'. The definition of `privileged', for these purposes, is that either the effective user ID is zero, or, if POSIX.1e capabilities are supported, that at least one capability is raised in either the Effective or Inheritable capability vectors. So, to match the document, I should change the prompt to PS1='%(!.#.$)' 2011/12/7 Jos Backus > What do you mean by 'document'? > > Jos > On Dec 6, 2011 9:35 PM, "Daniel Lin" wrote: > >> I think it may workable by following setting. >> But, I don't know how to get its document. >> >> zsh --version ~ >> 13:29:54 (1) >> zsh 4.3.12 (i686-pc-linux-gnu) >> >> PS1='%(#,#,$)' # simulate bash's \$ >> in normal user, it will display $ >> in super user, it will display # >> >> 2011/12/7 Jos Backus >> >>> Fwiw, here's what I am seeing (on FreeBSD -current using zsh 4.3.12): >>> >>> lizzy:~% % PS1='%# %(#,$,%%) ' >>> % % >>> % % >>> % % sudo -s >>> lizzy:/home/jos# PS1='%# %(#,$,%%) ' >>> # $ >>> # $ >>> >>> On Tue, Dec 6, 2011 at 9:03 PM, Daniel Lin wrote: >>> >>>> PS1='%# %(#,$,%%)' >>> >>> >>> >>> -- >>> Jos Backus >>> jos at catnook.com >>> >> >> --f46d043438983b126004b37b2bd3--