Please help this problem.
I would like to assigned variable (a=”echo 2012-03-16″) in the ‘BEGIN’ to the command ‘date’. The ‘date’ to getline and print ‘$0’.
Here’s an example:
awk 'BEGIN {a="echo 2012-03-16"; "date +%s -d "$a" " | getline; print $0}'
Thank you for your help.
adirectly inawk,$is not needed.date +%s -d 2012-03-16is sent to shell,echois not needed.