in reply to Script to manipulate data is not giving me any output

while(<MYINPUTFILE>) { cat /mnt/scripts/lagtime/tmp/input.txt |awk '{printf "%1.5 +0s\t%0.60s\t%0.45s\t %0.45s\n", $1, $2, $3, $4}' | sh /mnt/scripts/la +gtime/calculate_lag.sh > /tmp/snapvault_status.out.out; }

You're calling the awk command (or trying to... you forgot system) for every line in the input file (input.txt) without using that line anywhere in the command ...  What was the idea?

Replies are listed 'Best First'.
Re^2: Script to manipulate data is not giving me any output
by ebi (Initiate) on Sep 17, 2009 at 09:27 UTC
    Awk is needed to put the columns in the right place and then pipe the output to the calculate script which basically looks at a value higher then 24 and then is needs to be placed in the /tmp/snapvault_status.out.out file It looks like I should not use the while statement?
      It looks like I should not use the while statement?

      Yes, I can't see much use in it — except to slow down the processing ;)

      As it looks, calling it just once (using system !) should be sufficient.