Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Linux id command

by hotshot (Prior)
on Nov 23, 2003 at 16:52 UTC ( #309302=perlquestion: print w/replies, xml ) Need Help??
hotshot has asked for the wisdom of the Perl Monks concerning the following question:

Hi guys!

Is there perl eqvivalent to Linux id command (getting info about the user - uid, gid ...).


Replies are listed 'Best First'.
Re: Linux id command
by tcf22 (Priest) on Nov 23, 2003 at 17:11 UTC
    Real UID: $<
    Effective UID: $>
    Real GID: $(
    Effective GID: $)

    - Tom

      In addition, you can find the associated name using getgrgid()/getpwuid(). Also look at the related functions under the same perlfunc section.
Re: Linux id command
by davis (Vicar) on Nov 23, 2003 at 17:02 UTC

    Search perldoc perlvar for UID/GID.

    It's not easy to juggle a pregnant wife and a troubled child, but somehow I managed to fit in eight hours of TV a day.
Re: Linux id command
by eyepopslikeamosquito (Chancellor) on Nov 23, 2003 at 22:16 UTC
Re: Linux id command
by TVSET (Chaplain) on Nov 23, 2003 at 22:15 UTC
    Quote from perldoc perlfunc:
           Fetching user and group info
               "endgrent", "endhostent", "endnetent", "endpwent", "getgrent",
               "getgrgid", "getgrnam", "getlogin", "getpwent", "getpwnam", "getp-
               wuid", "setgrent", "setpwent"

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://309302]
Approved by mpeppler
[choroba]: Maybe the first four got downvoted and were deleted from the list?
LanX what?
marto deletes himself from the all lists
QM deletes himself from all delete lists
LanX passes the blame to jdpatches. ..
Eily the verb from this sentence

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2018-03-20 10:12 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (249 votes). Check out past polls.