rounding to nearest minute
I am having some trouble on rounding to nearest minute.
I have a file with different values. One of the columns is time.
What I need to do is rounding up and down depends on the number of seconds (if up to 30 then rounding down, if more then 30 rounding up). So 0:0:17 will become 00:00 and 0:26:49 will become 00:27.
I mention that I am on a bash shell.
read -a. Plain awesome...
You know, I've been into Linux/etal since 1995 (NetBSD on floppies from dial-up anyone?), and bash scripting the whole time, and I still learn magic from the clever people on this forum.
I had no idea you could even do 'read -a'. I guess the bash manpage is a bit verbose and I find myself grepping instead of actually reading.
Thank you watael for your arcane knowledge (which seems obvious now), and thanks to ralub for posting this (rather common) issue.