I want to add current date into the begin of the first line of the file.
please show me the way please with "date" commond and sed
Try this,
dat=`date "+%D" `
sed -ri "1s#(.*)#${dat}\1#" input_file
With awk:
awk 'BEGIN{system("date +%D")}1' file
sed -i "1s|^|$(date +%D) |" infile
I get illegal option with -i but it works well without it.
What is -i and what version does it apply to?
Its ok I just saw the earlier post