ls -l /md01/EL/MarketData/inbound/ststr/INVENTORY* |tail -5 |awk '{ print $5,$6,$7,$8,$9 }'
If I run the above from the command line the output to md_email is formatted correctly as
78213497 May 1 12:50 /md01/EL/MarketData/inbound/ststr/INVENTORY.20120430.PINESTREET.CSV.done
77904740 May 2 21:35 /md01/EL/MarketData/inbound/ststr/INVENTORY.20120501.PINESTREET.CSV
77904740 May 2 13:05 /md01/EL/MarketData/inbound/ststr/INVENTORY.20120501.PINESTREET.CSV.done
72218242 May 3 19:50 /md01/EL/MarketData/inbound/ststr/INVENTORY.20120502.PINESTREET.CSV
77839922 May 3 12:50 /md01/EL/MarketData/inbound/ststr/INVENTORY.20120502.PINESTREET.CSV.done
echo `ls -l ${indir}/${client}/CONTRACT* |tail -5 |awk '{ print $5,$6,$7,$8,$9 }'` >> $md_email
If I execute the above in a redirect to a file using a script the list does not maintain the file position -
78213497 May 1 12:50 /md01/EL/MarketData/inbound/ststr/INVENTORY.20120430.STATESTREET.CSV.done 77904740 May 2 21:35 /md01/EL/MarketData/inbound/ststr/INVENTORY.20120501.STATESTREET.CSV 77904740 May 2 13:05 /md01/EL/MarketData/inbound/ststr/INVENTORY.20120501.STATESTREET.CSV.done 72218242 May 3 18:33 /md01/EL/MarketData/inbound/ststr/INVENTORY.20120502.STATESTREET.CSV 77839922 May 3 12:50 /md01/EL/MarketData/inbound/ststr/INVENTORY.20120502.STATESTREET.CSV.done
I can't figure out if it's the file 'md_email' causing the issue or the way I am redirecting the command.