Extract strings between brackets for each line : <p>Suppose I have a text like this:</p>

<pre><code>a b [c] d [e]
f [g]
[h]
i j
k [l]
</code></pre>

<p>I'd like to ask how to extract the strings between brackets line by line using sed or awk command?</p>

<p>The output should be:</p>

<pre><code>c e
g
h

l
</code></pre>
