in reply to Counter && print issue

For the first part of your question, I think you want printf, which allows specifying column widths. Something like this (not tested):
printf "%s\n%25s%s%s%4s%s",color('white'),$elt, color('reset'),color('green'),'[Ok]',color('reset');

For the second part of your question, to count the number of times system returned 1, just declare a variable before the loop starts, and inside that elsif put $your_variable++. As others have mentioned, $? is probably closer to what you want; you have to muck about with the bits returned by system to get the program's exit status; see the documentation for details

Replies are listed 'Best First'.
Re^2: Counter && print issue
by giany (Acolyte) on Oct 08, 2005 at 12:22 UTC
    Thx for your input..i`ve tried what you said and now it gets like this :
    WAA[Ok] Longname.......[Ok] Onotherlognname...[Ok] Smalln[Ok]
    And I wanted to look like :
    WAA [Ok] Longname....... [Ok] Onotherlognname... [Ok] Smalln [Ok]
      Use a negative field width to get it left-aligned (yes, it's non-intuitive, but printf has been that way for a long time):
      printf "-26s %4s\n","WAA","[Ok]";