Bash regex string variable match
<p>I have the following script i wrote in perl that works just fine. But i am trying to achieve the same thing using bash.</p>
<pre><code>#!/usr/bin/perl

use 5.010;
use strict;

INIT {
    my $string = 'Seconds_Behind_Master: 1';
    my ($s) = ($string =~ /Seconds_Behind_Master: ([\d]+)/);
    if ($s &gt; 10) {
        print &quot;Too long... ${s}&quot;;
    } else {
        print &quot;It's ok&quot;;
    }
}

__END__
</code></pre>
<p>How can i achieve this using a bash script? Basically, i want to be able to read and match the value at the end of the string &quot;Seconds_Behind_Master: N&quot; where N can be any value.</p>