in reply to Too many pipes?

How did you determine it's the grep that "does not work"? Perhaps $node doesn't contain what you think it does? Or contains something special to the shell? Or perhaps what you're looking for isn't in the first $max lines you're examining?

Do you get a different result if you run the command from the command line?

Replies are listed 'Best First'.
Re^2: Too many pipes?
by kc6ovd (Acolyte) on Feb 10, 2012 at 18:40 UTC
    I can let the sub run with the "all nodes" in the $node so just the tail will run and it works. If I put anything in $node I get nothing back. Even if the node is something that was returned in all nodes. My only other check was to remove the grep from the elseif line to make sure that the logic was working when $node is other than all nodes. and I get the same output as from the "all nodes" tail. from command line I get what is expected.