What next?

Good question. I'm somewhat stumped...inside or outside of the loop, it should work the same way. Here's the code I tried (I used echo '' ) around it since I don't have aml_read)

#!/usr/bin/perl -w use strict; my $TTYFIRST = 2; my $TTYLAST = 17; my $start_ts = '"12/04/2000 07:00:00"'; my $end_ts = '"12/04/2000 08:00:00"'; my $selectedserver = 'ftwaeipd0001'; for (my $i = $TTYFIRST; $i <= $TTYLAST; $i++) { Tty_check($i,$start_ts,$end_ts,$selectedserver); } sub Tty_check { my $tty_string = 'tty'.$_[0]; my $tty = qx{echo 'aml_read /l trace /h $_[3] /a commproc /s $ +_[1] /b $_[2] /d all | egrep -c -e $tty_string'}; chomp($tty); print "<TR ALIGN=LEFT VALIGN=TOP>\n"; print "<TD>$tty_string</TD>\n"; print "<TD>$tty</TD>\n"; print "</TR>\n"; }
And it appear to do the Right Thing. Does it for you?

If so, how about trying to replace the big command with a smaller one. Try just running egrep on a file, or aml_read without piping through egrep. (Still do all of this inside the loop.) I'm guessing now, because this code should work.


In reply to Re: Re: Re: for SWIFTONE by swiftone
in thread for SWIFTONE by Motley

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.