1820390 Members
3680 Online
109623 Solutions
New Discussion юеВ

$OSNAME $OSREL $PLATFORM

 
SOLVED
Go to solution
ran_li
Regular Advisor

$OSNAME $OSREL $PLATFORM

Hello all,

a quick question regarding how I can print out $OSNAME $OSREL $PLATFORM those system define variables. Thanks.

Regards!
5 REPLIES 5
Pete Randall
Outstanding Contributor
Solution

Re: $OSNAME $OSREL $PLATFORM

OSNAME=`uname -s`
OSREL=`uname -r`
PLATFORM=`model`

echo $OSNAME $OSREL $PLATFORM

I think that gives you what you want.


Pete

Pete
ran_li
Regular Advisor

Re: $OSNAME $OSREL $PLATFORM

it does not need to assign the value first, for sure that way will work, but what I meant was ... I want to see current value not what I assigned.
Pete Randall
Outstanding Contributor

Re: $OSNAME $OSREL $PLATFORM

I'm not assigning the value, I'm querying what the value should be using available commands. Try running "uname -r".


Pete

Pete
Patrick Wallek
Honored Contributor

Re: $OSNAME $OSREL $PLATFORM

OSNAME, OSREAL and PLATFORM do not exist as default environment variables on HP-UX.

ran_li
Regular Advisor

Re: $OSNAME $OSREL $PLATFORM

ooh, my misunderstanding, I thought $OSNAME $OSREL come from the OS but it 's actually supported by other programs like autofs.

my situation here is I use enhanced autofs for OS dependent mount, it is working fine however only on one host it can not pick up $OSNAME properly, and it is actually not working for only one of the mount, other mounts are working fine, so I was wondering what is the $OSNAME value right now. I may need to check automount or automountd for this issue.

Thanks for the comments.

Regards!