Unix Shell - arithmetics & regular expressions

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > February 2005 > arithmetics & regular expressions





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author arithmetics & regular expressions
pier0pieru@yahoo.it

2005-02-10, 5:58 pm

I know my ego will be zeroed by a shower of one-liners, anyway, here's
my question. To be completely frank, I was trying to shift the timings
in a subs file. The images are off by 10 seconds, so I needed to change
every occurrence like hh:mm:ss (e.g.: 01:12:55) to hh:mm:tt, where
tt=ss+10. With the additional problem, of course, that tt+10 might be
>59 and the excess seconds should be converted into minutes etc.etc.

Now the math is quite easy, but: is there an efficient tool like sed to
replace text in a stream of ascii AND at the same time capable of some
rudimentary arithmetics? Or else, my only option is to write a script
in bash? I can do it (well, give me the time to learn some bash) but I
was curious about the options. Thank you!

Piero

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com