system("finger$_  $_");

Let's say one of your hosts in hosts.txt is named "foo", then your command line would expand to

fingerfoo foo

Probably not what was intended...

Update: perhaps you meant something like "ssh host last -n1"1 ? (see "man last")  With finger, you'd need to specify some user ("finger user@host"), so this probably isn't what you want — and depending on your site configuration, remote fingering (i.e. @host) may not work at all.

___

1 after seeing Utilitarian's reply, I realize that "the last login and time for every system" can be read in several ways. The way I understood it was that you wanted to know when anyone last logged in on those hosts, not from those hosts to your local machine...


In reply to Re: Last logon and time for a system console by almut
in thread Last logon and time for a system console by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.