How to take the absolute value using 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))}'
The common trick for this kind of situations is to use square root of the square:
awk -F'[-,]' '{print sqrt((360*($4-$1)+30*($5-$2)+($6-$3))^2)}'
Another way:
awk -F'[-,]' '{d=360*($4-$1)+30*($5-$2)+($6-$3);print (d>0)?d:-d}'