bug628796: reduced number of processes by changing "cat XXXX | sed YYYY" with "sed -e YYYY XXXX" and also tidied up logging output