Determining machine architecture and ULTRIX version

Bill Collins collins at grumpy.cs.unm.edu
Wed Oct 25 04:38:20 AEST 1989


In article <2785 at decuac.DEC.COM> avolio at decuac.dec.com writes:
>You can use the command "machine".
>
>Returns "mips" or "vax".
>

Ok, I run machine on a DECstation and get:
mips
This is, I guess, another way of saying decstaion.

Now, on a vax it gives:
machine:  Command not found.
Ok, I get it, "Command not found." is another way of saying VAX. :-)

Oh, thats ok, the sun has them in command form.
% sun
returns true.
% vax
returns false.
% mips
returns:
mips: Command not found.

Gee, I wish it were somewhat standard.  I end up using the /usr/lib/cpp and
feeding it a list of defines(vax, mips, sun, ibm, etc) to do this.  And with
a little tweaking, you can get it to return some sort of message like:

% whatami
Says mips, Its little endian, Probably a DECstation.
%
				
				Bill
				collins at turing.cs.unm.edu
			collins at unmvax.unm.edu
			gatech!unmvax!collins

-------------------
Have you been bussed today?



More information about the Comp.unix.ultrix mailing list