soup4you2
October 4th, 2003, 19:58
Would anybody care to enlighten me on this one..

If a normal user runs:

echo $OSTYPE you get a "freebsd5.1" or your OS in return..

where if root runs it you get "FreeBSD"

is there a reason for these diffrences?

if you sudo you get the 5.1 which is all good... but why is r00t's diffrent.

v902
October 4th, 2003, 21:04
I'm out on a limb I think root is:

kern.ostype

and normal luser is:

kern.ostype + kern.osrelease


EDIT: Try changing 'em and see what happens.

frisco
October 4th, 2003, 21:12
Different shell or initialization files?

As for using sudo, variable expansion happens before the shell runs the command.

v902
October 4th, 2003, 22:00
Had a friend do this...

[code:1:db51f60f1b]$ echo $OSTYPE
freebsd4.8
$ su
Password:
TERM=vt100
# echo $OSTYPE
freebsd4.8
# [/code:1:db51f60f1b]

It may be different for 4.X and 5.X I'd play around with kern.ostype and kern.osversion and see what happens