Is there an alternative to "whoami" ?
who am i
/usr/ucb/whoami
haha never knew "who am i" - thanks
But watch out, they can return different results, an example:
----------
me@trout:/home/me $ su -
Password:
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
root@trout:/root # who am i
me pts/1 Jun 30 17:27 (cod.mydom.net)
root@trout:/root # whoami
root
root@trout:/root #
--------------
'who am i' returns who you logged in as, where as '/usr/ucb/whoami' returns
your effective ID, not always the same either.
It is best to add ucb to your search path:
PATH=$PATH:/usr/ucb:/usr/sfw/bin:/usr/ccs/bin
export PATH
> It is best to add ucb to your search path:
Not! His next question then will be why cc doesn't work.
Worse, if /usr/ucb is not *last* in the $PATH ps will not work as expected
either.
> Is there an alternative to "whoami" ?
Yep:
/usr/xpg4/bin/id -un
rich@zen4153# /usr/xpg4/bin/id -un
rich
--
Rich Teer, SCSA, SCNA, SCSECA
CEO,
My Online Home Inventory
URLs: http://www.rite-group.com/rich
http://www.linkedin.com/in/richteer
http://www.myonlinehomeinventory.com
> It is best to add ucb to your search path:
Not it is NOT! /usr/ucb is an anacronism, best forgotten in this
day and age.
> On Mon, 30 Jun 2008 23:35:16 +0000, Canuck57 wrote:
>> It is best to add ucb to your search path:
> Not! His next question then will be why cc doesn't work.
: > Good one
> Worse, if /usr/ucb is not *last* in the $PATH ps will not work as expected
> either.
One might try using aliases for /usr/ucb stuff and /usr/xpg? stuff
Keeps PATH clean
Or, if running Nevada or OpenSolaris, just have /usr/gnu/bin in the $PATH.
Heh!, that's not even necessary:
duhring@einstein:~$ which whoami
/usr/bin/whoami
I havent checked my b90 install for /usr/ucb - hope they dont do away
with it but who knows.
Thing is, a GNU version of something isnt always "better" than the
original.
Is there a vipw for example? Probably not. /usr/ucb/shutdown can get
you
out of some jams that the svr4 descendant cannot. /usr/ucb is small
sans
all the symlinks. I hope it survives the current wave of
"we gotta make Solaris more Lienux friendly" types developing at Sun
nowadays : >
> On Jun 30, 10:37 pm, Dave Uhring <daveuhr...@yahoo.com> wrote:
>> On Mon, 30 Jun 2008 21:44:06 -0700, AGT wrote:
>>> On Mon, 30 Jun 2008 19:19:35 -0500, Dave Uhring wrote:
>>>> Worse, if /usr/ucb is not *last* in the $PATH ps will not work as expec
> ted
>>>> either.
>>> One might try using aliases for /usr/ucb stuff and /usr/xpg? stuff
>>> Keeps PATH clean
>> Or, if running Nevada or OpenSolaris, just have /usr/gnu/bin in the $PATH.
>
>> Heh!, that's not even necessary:
>> duhring@einstein:~$ which whoami
>> /usr/bin/whoami
>
> I havent checked my b90 install for /usr/ucb - hope they dont do away
> with it but who knows.
It is still there in b91, as is /usr/ucblib and /usr/ucbinclude.
Cheers,
Chris
> I havent checked my b90 install for /usr/ucb - hope they dont do away
> with it but who knows.
With Sun's promise of backward compatibility /usr/ucb and cousins will
probably remain for some time to come.
> Thing is, a GNU version of something isnt always "better" than the
> original.
Granted, but sometimes the GNU versions do have additional or different
utility. Additionally, the presence of such penguinware eases the
transition for Linux emigrés.
The -r option in GNU's grep is quite handy, for instance.
Cheers,
Chris
> The -r option in GNU's grep is quite handy, for instance.
You mean it's easier than find . -type f -exec grep pattern {} + ;>
Not to mention -A and -B