January 3, 2011

Solaris: alternative commands to retrieve hardware architecture

Posted in Solaris at 12:00 pm by alessiodini

today in my free time i’m playing with some fun commands.
I think can be useful use these commands for scripting.

One of them is sparc command. for example in this uname -a output i have:

SunOS system1 5.10 Generic_xxxxx-xx sun4u sparc SUNW,Sun-Fire-15000

If i would determine hardware architecture , could be useful use grep command in previous output.
In this case i’ll use sparc command as follow:

root@system1 # sparc
root@system1 # echo $?
0

From man page:
NAME
machid, sun, iAPX286, i286, i386, i486, i860, pdp11, sparc,
u3b, u3b2, u3b5, u3b15, vax, u370 – get processor type truth
value

DESCRIPTION
The following commands will return a true value (exit code
of 0) if you are using an instruction set that the command
name indicates.

In my case sparc is for:
User Commands machid(1)

sparc True if you are on a computer using a
SPARC-family processor.

So i have uname command that refereers to utsname struct and these alternative commands , fun !

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: