So I\'m pretty lost as I missed a week and am playing catch up, but I\'m to write an awk program to tell the difference, in days, between two dates.
I\'m more or les
I tried the answer suggested by @paxdiablo. It ended up stripping the non-leading zeros as well.
$ echo '20/02/1965' | awk '{gsub ("^0*", "", $0); gsub ("/0*", "/", $0); print}'
2/2/1965
Using sub
instead gsub
worked fine for me.
$ echo '20/02/1965' | awk '{sub ("^0*", "", $0); sub ("/0*", "/", $0); print}'
20/2/1965