jeudi 25 août 2016

How can I concat current date with title in shell script?

I am working on shellscript with excel sheet. Till now I have done as shown in screenshot by using below command:

bash execution.sh BehatIPOP.xls| awk '/Script|scenario/' | awk 'BEGIN{print "Title\tResult"}1' | awk '0 == NR%2{printf "%s",$0;next;}1' >> BehatIPOP.xls

enter image description here

My requirement is along with the heading Result I want to add(concat) current date also. So I am getting date by using below command:

$(date +"%d-%m-%y %H:%M:%S")  

So date will display like this : 25-08-2016 17:00:00

But I am not getting how can use date command in the above mentioned command to achieve heading like below:

 |      Title       |   Result @ 25-08-2016 17:00:00|

Thanks for any suggestions..

Aucun commentaire:

Enregistrer un commentaire