If I have below two dates: 2015-09-12,2015-08-13And I need to get the number of days between them, I will use the below code: awk -F'[-,]' '{print 360*($4-$1)+30*($5-$2)+($6-$3)}'The output for this code will be -29 while actually the difference is 29Please advise, 
How to take the absolute value using awk?
bash;text processing;awk
You can define functions in  awk like:awk -F'[-,]' '  function abs(v) {return v < 0 ? -v : v}  {print abs(360*($4-$1)+30*($5-$2)+($6-$3))}'