adding command output to each line of file
I wrote about changing of certain columns in a file, but here let’s solve a simpler task. I’d like to add something, let’s say date, to every line of a file. I’ll emulate a file using `seq 1 10`.
The following is easy enough:seq 1 10 | awk '{print "echo `date` "$0}' | bash
However, there’s simpler solution:seq 1 10 | while read ; do echo `date` ${REPLY} ; done
It works because REPLY variable is set to the line of input read by the read builtin command when no arguments are supplied (from bash manpage).

