zsh-users
 help / color / mirror / code / Atom feed
From: "Thomas Köhler" <jean-luc@picard.franken.de>
To: Daniel Lin <dlin.tw@gmail.com>
Cc: Bart Schaefer <schaefer@brasslantern.com>, Zsh Users <zsh-users@zsh.org>
Subject: Re: How to display zsh is 32/64 bit?
Date: Fri, 9 Dec 2011 09:04:35 +0100	[thread overview]
Message-ID: <20111209080435.GA29537@picard.franken.de> (raw)
In-Reply-To: <CAPg-njyNtTVyp=1uBv+yxYTcpQ0ZD0KwsnFE2W+s7DWUGue3Nw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 996 bytes --]

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@picard.franken.de
     <><             WWW:              http://gott-gehabt.de
                     IRC: tkoehler       Freenode: thkoehler
                     PGP public key available from Homepage!

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2011-12-09  8:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09  4:34 Daniel Lin
2011-12-09  8:04 ` Thomas Köhler [this message]
2011-12-09  8:44   ` Daniel Lin
2011-12-09 13:49 ` Peter Stephenson
2011-12-09 15:38   ` Dan Nelson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111209080435.GA29537@picard.franken.de \
    --to=jean-luc@picard.franken.de \
    --cc=dlin.tw@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).