Jugando con variables en bash I

Me llegó a mis ojos un pedazo de código en BASH, y busqué explicarlo:
function RENOMBRA ()
{
NRO=0
for I in `ls -1`
do
        FNAME="${I##*/}"; EXT="${FNAME##*.}"
        [ "${EXT}" == "${FNAME}" ] && EXT="" || EXT=".${EXT}"
        mv $I $NPRE-$NRO$EXT
        NRO=$[$NRO+1]
done
}
FNAME="${I##*/}" corresponde a:
${parameter##word}
The word is expanded to produce a pattern just as in pathname expansion. 
If the pattern matches the beginning of the value of parameter, then the 
result of the expansion is the expanded value of parameter with the shortest 
matching pattern (the ``#'' case) or the longest matching pattern 
(the ``##'' case) deleted. If parameter is @ or *, the pattern removal
operation is applied to each positional parameter in turn, and the expansion
is the resultant list. If parameter is an array variable subscripted with  @ or *,
the pattern removal operation is applied to each member of the array in turn,
and the expansion is the resultant list.
quiere decir, $I (es nombre del archivo) y aplica el pattern */ haciendo una "removal operation": el resultado es que queda de la ultima '/' para adelante,
  1. "nico" -> "nico"
  2. "nico/cesar" -> "cesar"
  3. "nico/" -> ""
Es facilmente aplicable a $EXT para determinar la extensión a partir del ultimo punto :-D