[comp.unix.ultrix] Shell script to determine CPU

jpm@lanl.gov (Pat McGee) (10/06/87)

On Suns, and on Vaxen running Berkeley Unix, there exist
programs in /bin to tell a caller if the caller is running
on a sun or on a vax (i.e., /bin/vax returns true on vaxes,
false on suns, etc.).  I'm running on a network that has
both Suns and Unix Vaxen, as well as an Ultrix Vax, and I
would like my .login to set an environment variable with the
name of the CPU (e.g.  sun3, sun2, vax).  So far, I haven't
found any reliable way to do this on Ultrix.  I hear that
the problem also exists on all other Unix's derived from ATT
V5, but have no personal experience to back that up.

Is there a solution?

Thanks for reading this, and hopefully, thanks for replying.

Pat McGee, jpm@lanl.gov, (505) 667-4196

fuat@cunixc.columbia.edu (Fuat C. Baran) (10/08/87)

I wrote a little program called 'uname' which uses uname(2) to get 
the system type, node name, version, release, machine type info and
pretty print it.

I can send you a copy if you wish.

						--Fuat
-- 
ARPANET: fuat@columbia.edu           U.S. MAIL: Columbia University
BITNET:  fuat@cunixc.columbia.edu               Center for Computing Activities
USENET:  ...!rutgers!columbia!cunixc!fuat       712 Watson Labs, 612 W115th St.
PHONE:   (212) 280-5128                         New York, NY 10025

barnett@steinmetz.UUCP (Bruce G Barnett) (10/12/87)

	Suns have a program called '/bin/arch' that returns
the CPU type (e.g. sun2, sun3, sun4). You or your sysadmin could
create one on your vaxen. You could also test for the existance of
the program, and if not there - assume a vax.

Oh - the program arch for a vax would be

	echo "vax"


-- 
	Bruce G. Barnett 	<barnett@ge-crd.ARPA> <barnett@steinmetz.UUCP>
				uunet!steinmetz!barnett

gwyn@brl-smoke.arpa (Doug Gwyn ) (10/14/87)

Reply-Path:



In article <8542@felix.UUCP> fuat@cunixc.columbia.edu (Fuat C. Baran) writes:
>I wrote a little program called 'uname' which uses uname(2) to get 
>the system type, node name, version, release, machine type info and
>pretty print it.

Doesn't Ultrix have the standard System V "uname" utility?
I hope your version is compatible..

fuat@cunixc.columbia.edu (Fuat C. Baran) (10/20/87)

Reply-Path:



In article <9430@felix.UUCP> gwyn@brl-smoke.arpa (Doug Gwyn ) writes:
>Doesn't Ultrix have the standard System V "uname" utility?
>I hope your version is compatible..

I couldn't find one.  The only thing I found was uname(2), so I wrote
my own.  I very much doubt that it is compatible since I have never
run the SysV version...  It should be trivial to massage the data
returned by uname(2) into whatever format you wish.

					--Fuat


-- 
ARPANET: fuat@columbia.edu           U.S. MAIL: Columbia University
BITNET:  fuat@cunixc.columbia.edu               Center for Computing Activities
USENET:  ...!rutgers!columbia!cunixc!fuat       712 Watson Labs, 612 W115th St.
PHONE:   (212) 280-5128                         New York, NY 10025