From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7591 invoked by alias); 9 Dec 2011 08:44:54 -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: 16613 Received: (qmail 10216 invoked from network); 9 Dec 2011 08:44:43 -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 :content-type; bh=cvF+w3Ofu1ZQDAZ4F+9rv3nMRYZmQLtTlxDS9Ds74JQ=; b=m/sLo3yImEyNQHsUJzPwo8SbGLFNociNgC2J89ES8WLgvuchxJmg/8k1m2KNt7fA2L W0yQB4myFe/hFbNo0ZFSSDwyBsKoHOEbBDsS9tMBJQvft/XQPvQKs8xSquHSarHu8arr cbVp9RWVN4mlTUlOlgZNHyYdxh4DKQAG0xNEg= MIME-Version: 1.0 In-Reply-To: <20111209080435.GA29537@picard.franken.de> References: <20111209080435.GA29537@picard.franken.de> Date: Fri, 9 Dec 2011 16:44:36 +0800 Message-ID: Subject: Re: How to display zsh is 32/64 bit? From: Daniel Lin To: Daniel Lin , Bart Schaefer , Zsh Users Content-Type: multipart/alternative; boundary=f46d0434389879c74904b3a4cb5f --f46d0434389879c74904b3a4cb5f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks, Thomas, it works. But, because the 'file' utility is not installed on my arch32-light environment. So, I use a more stupid method: create a symbol file (eg. /opt/arch32/etc/pacman32.conf) if [ -f /etc/pacm32.conf ] ; then PS1=3D"32 " // in arch32 else PS1=3D"64 " // in arch64 fi 2011/12/9 Thomas K=C3=B6hler > Hi Daniel, > > Daniel Lin wrote: > > To do cross compile of 32/64 bit program on one machine.(which installe= d > > 64-bit zsh) > > I use ArchLinux x86_64 as host machine. > > And a arch32 chroot environment for 32-bit compiling(which installed > 32-bit > > zsh). > > > > One problem is the PS1 of zsh. > > It will display the same on both environment. > > I'm wonder could I show different prompt inside the chroot environemnt? > > > > If zsh's prompt variable can deal this? > > On Linux, you can simply do something like this: > > PS1=3D$(file -L /proc/$$/exe | sed -e 's/.*ELF //' -e 's/-bit.*/ /') > > On my 64 bit (debian derivative) system, that yields a PS1 of "64 ", > while in the 32 bit (debian) chroot, that yields a PS1 of "32 ". > > Ciao, > Thomas > > -- > Thomas K=C3=B6hler Email: jean-luc@picard.franken.de > <>< WWW: http://gott-gehabt.de > IRC: tkoehler Freenode: thkoehler > PGP public key available from Homepage! > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.3 (GNU/Linux) > > iD8DBQFO4cETTEYXWMJlHuYRAlEIAJ4tsF/kY8Ldtt25rQFDOuOGNAf44ACffbMf > WphBIFarW6FTf9X+TiV5Txk=3D > =3DhQ4Q > -----END PGP SIGNATURE----- > > --f46d0434389879c74904b3a4cb5f--