Get file extension with bash script : <p>i' m trying to extract the file extension in bash without using regex.
i' ve tried the following </p>

<pre><code>extension = $(echo $1 | cut -f 2 -d '.')
</code></pre>

<p>extension is the variable 
$1 contains something like: file.txt or file.pdf etc.
this code is outputting:</p>

<pre><code>./prova.sh: 3: ./prova.sh: extension: not found
</code></pre>
