Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Searching for variable GECOS for zsh?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
boospy
Apprentice
Apprentice


Joined: 07 Feb 2010
Posts: 218
Location: Austria

PostPosted: Sat Apr 06, 2013 11:14 pm    Post subject: Searching for variable GECOS for zsh? Reply with quote

Hi,

i'am search for an variable to show the real name from an User in shell/zsh. For example this is working:
Code:
Welcome $USER

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
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1539

PostPosted: Sun Apr 07, 2013 9:45 am    Post subject: Reply with quote

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
View user's profile Send private message
boospy
Apprentice
Apprentice


Joined: 07 Feb 2010
Posts: 218
Location: Austria

PostPosted: Sun Apr 07, 2013 12:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1539

PostPosted: Sun Apr 07, 2013 10:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
boospy
Apprentice
Apprentice


Joined: 07 Feb 2010
Posts: 218
Location: Austria

PostPosted: Sun Apr 07, 2013 10:10 pm    Post subject: Reply with quote

Ok, no problem, finger looks a little bit strange.... we will see :)

Greetings
boospy
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum