proper way to determine arch of *installed* OS, not processor?

Robert P. J. Day rpjday at crashcourse.ca
Fri May 6 15:34:03 UTC 2011


On Fri, 6 May 2011, Jesse Palser wrote:

> On 05/06/2011 11:14 AM, Robert P. J. Day wrote:
> >    what is the proper incantation to determine the word size of the
> > installed OS?  that is, if i've installed the 32-bit version of ubuntu
> > on a 64-bit system, i want to know that the OS is 32 bits, even as the
> > processor is 64 bits.  i'm sure it's some option of "uname", but i
> > don't have such a system lying around to test it.  thanks.
> >
> > rday
>
> Hi,
>
> I did not know either, Google found this:
> uname -a
> (type in terminal)

  i'm not sure that's correct, and i know this question comes up on
occasion.  in fact, a quick google found this:

http://stackoverflow.com/questions/246007/how-to-determine-whether-a-given-linux-is-32-bit-or-64-bit

where someone first suggests "uname -m", but a followup claims that
that command with a 32-bit debian OS on a 64-bit system claims 64
bits, which is not the answer one would want.

  i ask since i'm looking at a startup script for software i just
downloaded where that wrapper reads:

#!/bin/sh
GDK_NATIVE_WINDOWS=1
if [ "a" = "a$(uname -m | grep 64)" ]; then # computer is 32-bits
        unset UBUNTU_MENUPROXY; export GDK_NATIVE_WINDOWS=1; ./TalendOpenStudio-linux-gtk-x86
else
        unset UBUNTU_MENUPROXY; export GDK_NATIVE_WINDOWS=1; ./TalendOpenStudio-linux-gtk-x86_64
fi

  which would give the wrong answer if the person making that
debian claim is correct.  so, what is the canonical way to check this?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================




More information about the ubuntu-users mailing list