in reply to SCALAR output instead of attribute name.

See perldoc getpwent

That will avoid messing directly with /etc/passwd. It is portable across platforms and works with shadow and other variants.

After Compline,
Zaxo

  • Comment on Re: SCALAR output instead of attribute name.

Replies are listed 'Best First'.
Re: Re: SCALAR output instead of attribute name.
by sschneid (Deacon) on Dec 18, 2003 at 18:33 UTC
    I wasn't looking for portability across platforms, I was looking for something to work on multiple remote hosts. Unless I rework the script into a client-server design, this still doesn't look like it'll work for me. As it stands (and for simplicity sake), I'm cating /etc/passwd over ssh, and parsing what is returned.

    -s.

      With ssh or scp, you can send your portable script to your account on each host. Then when you want to poll hosts for their user accounts, ssh -2 user@host ./myscript.pl for each host in your polling script.

      No client/server involved but portability matters.

      After Compline,
      Zaxo