1

I want to find out which machine I have logged in to my current terminal from. But "who -m" does not work. It does on Linux, but not on Solaris. Any ideas what I might be doing wrong?

myhost2:/home/myuser> who
myuser   pts/1        Aug  9 07:35   (myhost.mydomain.com)
myuser   pts/2        Aug  9 08:42   (myhost.mydomain.com)
myuser   pts/3        Aug  9 08:42   (myhost3.mydomain.com)

myhost2:/home/myuser> who -m
myuser   pts/2        Aug  9 08:42

myhost2:/home/myuser> who am i
myuser   pts/2        Aug  9 08:42

myhost2:/home/myuser> which who
/usr/bin/who

myhost2:/home/myuser> alias who
who: alias not found

myhost2:/home/myuser> uname -a
SunOS myhost2 5.10 Generic_138889-08 i86pc i386 i86pc

myhost2:/home/myuser> tty
/dev/pts/2

myhost2:/home/myuser> TTY=$(tty | cut -c 6-);who | grep "$TTY " | awk '{print $6}' | tr -d '()'
myhost.mydomain.com
dogbane
  • 4,566

1 Answers1

2

A Solaris 10 box here seems to do the right thing:

$ uname -srv
SunOS 5.10 Generic_138889-08

$ who -m
myuser     pts/2        Aug  9 10:00    (hostname.my.domain.com)

Might this be dependent on how you are logging into the Solaris box? SSH / Telnet / XTerm ?

njd
  • 11,206
  • That's interesting. I'm using putty SSH. It's strange that "who" shows me my machine, but "who -m" doesn't. – dogbane Aug 09 '10 at 10:55
  • Hmm. PuTTY here too. And of course the general "who" and "who -a" show the connecting host. – njd Aug 09 '10 at 15:57
  • who is probably an alias, which may be why who -m misbehaves. alias who will show you if it is an alias. – jim mcnamara Aug 10 '10 at 21:34
  • nope, who is not an alias. Even the fully qualified command "/usr/bin/who -m" produces the same output. – dogbane Aug 11 '10 at 09:35