Re: Help with Perl script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dave,

If you change

open(INPUT, "<'metastat'");

to

open(INPUT, "<metastat");



[]s
Marcos


On Tue, Mar 24, 2009 at 7:14 PM, Anth Courtney <anth.courtney@xxxxxxxxxx>wrote:

> Dave,
>
> On Tue, 24 Mar 2009, Dave Martini wrote:
>
> > I'd like to run a command called metastat and have it search its output
> > for the word Ok but what I have so far doesn't work. Anyone have any
> > suggestions?
> >
> > #!/bin/perl
> > $target = "Ok";
> > open(INPUT, "<'metastat'");
>
> Change this line to
>
> open(INPUT, "metastat|");
>
> > while (<INPUT>) {
> > if (/$target/) {
> >                 print  "Found $target\n";
> > }
> > }
> > close(INPUT);
>
> cheers,
> Anth
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>
-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux