How to list $PATH?
<p>When I <code>echo $PATH</code> 
I get: <code>home/x/bin:home/x/.local/bin:...:...</code> and on and on where each path is separated by <code>:</code> </p>

<p>When I <code>echo $PATH | tr ':' '\n'</code>
I get:</p>

<pre><code>home/x/bin
home/x/.local/bin
...
...
</code></pre>

<p>Where very path is separated by a new line</p>

<p>So now I want to fit all of this into a variable (<code>$</code>) or a script so I can execute it and it lists the path by line, but it wont work:</p>

<p>I tried: <code>x=${echo $PATH | tr ':' '\n'}</code><br>
but I get <code>-bash: ${echo $PATH | tr ':' '\n'}: bad substitution</code></p>

<p>I also tried a script where:</p>

<pre><code>#!/bin/bash
echo $PATH &gt; 11
sleep 1
bb=${`tr ':' '\n' &lt; 11`}
echo $bb
</code></pre>

<p>What can I do?</p>