volks,

As a form of penance - let us just say that I thought about
solving the problem of how would I do the simple

vladimir: 58:] who -m
drieux     pts/1        Jun  7 11:56    (jeeves)
vladimir: 61:] who -m | perl -e 'print "$1\n" if (<STDIN>=~m/\((.*)\)/);'
jeeves
vladimir: 62:]

without the needs to have 'who' in there - and OYE, is it
not like anything I would advocate - since this is way too
hand crafted, requires major ugliness, is not portable, and
is clearly not for the faint of heart.

http://www.wetware.com/drieux/pbl/Sys/Admin/uglyWhoLessResponse.txt

but it does work on at least one machine

        [jeeves:pbl/Sys/Admin] drieux% perl uglyWhoLessResponse.txt
        wetware:0.0
        [jeeves:pbl/Sys/Admin] drieux%

in the case that one is host local, and one does not take an
error trying to read the utmp file directly, one will get

        [jeeves:pbl/Sys/Admin] drieux% perl ugl*
        :0.0
        [jeeves:pbl/Sys/Admin] drieux% who -m
        drieux   ttyp4    Jun  7 10:57
        [jeeves:pbl/Sys/Admin] drieux%

which leads me back to the old maxim - convert what you need to
into the coding language of your choice - but rather than try to
rewrite certain basic 'unix power tools' - especially the ones
that were not already ported to being all in perl - then you should
think in terms of the

        open(INPUT, "$cmd $arg|") or die "unable to open $cmd with $args:$!\n";
        while(<INPUT>) {
                #what you want to do with that command
        }
        close(INPUT);

remember the basic maxim:

        we code in perl because management is underclear
                on what the deliverable should be, but has firm
                        opinions on the deliverable date....

ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to