Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to display zsh is 32/64 bit?
- X-seq: zsh-users 16613
- From: Daniel Lin <dlin.tw@xxxxxxxxx>
- To: Daniel Lin <dlin.tw@xxxxxxxxx>, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: How to display zsh is 32/64 bit?
- Date: Fri, 9 Dec 2011 16:44:36 +0800
- 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=
- In-reply-to: <20111209080435.GA29537@picard.franken.de>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAPg-njyNtTVyp=1uBv+yxYTcpQ0ZD0KwsnFE2W+s7DWUGue3Nw@mail.gmail.com> <20111209080435.GA29537@picard.franken.de>
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="32 " // in arch32
else
PS1="64 " // in arch64
fi
2011/12/9 Thomas Köhler <jean-luc@xxxxxxxxxxxxxxxxx>
> Hi Daniel,
>
> Daniel Lin wrote:
> > To do cross compile of 32/64 bit program on one machine.(which installed
> > 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=$(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öhler Email: jean-luc@xxxxxxxxxxxxxxxxx
> <>< 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=
> =hQ4Q
> -----END PGP SIGNATURE-----
>
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author