% cat testfile
I want to append the date at the end of each line.
I have tried the following, but neither is working.
% while read line; do printf "%s,%s\n" "$line" $(date '+%d-%m-%Y'); done <testfile
I want to append the date at the end of each line.,21-06-2011
I have tried the following, but neither is working.,21-06-2011
% var=$(date '+%d-%m-%Y')
% while read line; do printf "%s,%s\n" "$line" "$var"; done <testfile >outputfile
% cat outputfile
I want to append the date at the end of each line.,21-06-2011
I have tried the following, but neither is working.,21-06-2011