bash - Asterisk: How to convert time to seconds -


i want print result when $9 greather 1 hour
how can convert seconds? can use 3600sec check.

$9 = duration of call 00:00:00

asterisk -rx "core show channels verbose" | awk '$9 > "01:00:00"' | awk '$6 == "dial"' | wc -l > test.txt

as mentioned, easiest thing check if first 2 digits of time not "00". this:

asterisk -rx "core show channels verbose" | awk '$9 !~ /00:..:../ && $6 == "dial"' | wc -l 

that means match , record "01:00:00" may not want :-( . matches "$9 greater or equal 1 hour".

this match "greater than" condition:

asterisk -rx "core show channels verbose" | awk '$9 !~ /00:..:../ && $9 != "01:00:00" && $6 == "dial"' | wc -l 

Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -