Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How to display zsh is 32/64 bit?



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!

Attachment: signature.asc
Description: Digital signature



Messages sorted by: Reverse Date, Date, Thread, Author