UNIX: Sort files by number/version without 0 padding
<p>Ultimately, I wanted to set the latest version as an environment variable, so supplementing the selected answer (which provided me the correct sorting):</p>

<pre><code>export LATEST_VERSION=$(printf '%s\n' * | sort -rV | head -1)
</code></pre>

<hr>

<p>I have a directory with the following directory names:</p>

<pre><code>ls -1r .
2.0
1.8
16.1
16.0
15.5
15.0
14.5
14.1
14.0
1.3
1.2
1.1.5
1.1.3
1.1.2
</code></pre>

<p>I would like to sort them to get the latest release version:</p>

<pre><code>ls -1r . | head -1
16.1
</code></pre>

<p>So the underlying order should look like this:</p>

<pre><code>16.1
16.0
15.5
15.0
14.5
14.1
14.0
2.0
1.8
1.3
1.2
1.1.5
1.1.3
1.1.2
</code></pre>

<p>Any help would be greatly appreciated. Simpler the better, but I'm open to any solution. Thanks!</p>