View previous topic :: View next topic |
Author |
Message |
boospy Guru
Joined: 07 Feb 2010 Posts: 308 Location: Austria
|
Posted: Sat Apr 06, 2013 11:14 pm Post subject: Searching for variable GECOS for zsh? |
|
|
Hi,
i'am search for an variable to show the real name from an User in shell/zsh. For example this is working:
But the username is often very different to the real name, is there an variable to set this like $GECOS?
Greetings
boospy |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Sun Apr 07, 2013 9:45 am Post subject: |
|
|
boospy ...
finger can query GECOS, assuming the admin has added such things, and users haven't removed it (chfn) :) So, you would need net-misc/netkit-fingerd with fingerd running locally and have echo "Hello $(finger -g $USERNAME@$HOST)" as MOTD or in .zlogin.
best ... khay |
|
Back to top |
|
|
boospy Guru
Joined: 07 Feb 2010 Posts: 308 Location: Austria
|
Posted: Sun Apr 07, 2013 12:27 pm Post subject: |
|
|
Thanks for your message, but something is wron. I installed inetd and netkit-fingerd. When i have a look at
Code: | nano /etc/xinetd.d/fingerd |
Code: | service finger
{
socket_type = stream
protocol = tcp
wait = no
user = nobody
server = /usr/sbin/in.fingerd
server_args = -w
disable = yes
} |
I think thats looks ok, but when test this:
Code: | echo "Hello $(finger -s $USERNAME@$HOST)"
finger: connect: Connection refused
Hello [hostname.domain] |
Greetings
boospy |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Sun Apr 07, 2013 10:03 pm Post subject: |
|
|
boospy ...
I'm really not familiar with running fingerd, and so I'm not sure what the issue is with the above, from the error it looks as though it expects 'hostname.domain' and not simply hostname.
HTH & best ... khay |
|
Back to top |
|
|
boospy Guru
Joined: 07 Feb 2010 Posts: 308 Location: Austria
|
Posted: Sun Apr 07, 2013 10:10 pm Post subject: |
|
|
Ok, no problem, finger looks a little bit strange.... we will see
Greetings
boospy |
|
Back to top |
|
|
|