How to get length of variable bash?
<p>I use Cent OS 7, and have written a Bash script.</p>

<p>I tried to get the length of variable:</p>

<pre><code>#!/bin/bash
URL_STRING="1";
VAR_LENGTH=${#URL_STRING}
echo $VAR_LENGTH;
</code></pre>

<p>But I get syntax error</p>