miii una rizla fa' miracoli....
forse cosi' e' un po' piu' decente
anche perche' vi da' l'output classico dell'ls ...buon div

codice:
#!/bin/bash 
#lsnum.sh list directory contents 
#with permission in octal mode
#pierluigi previtali 2004
#bashing for fun totally copylefted
#vers 0.2 
#aka stupid_enough_to_work_for_me

#func declare here
LetterToNums() {
		case $1 in 
		rw-------) NPERM=600
		;;
		rw-r--r--) NPERM=644
		;;
		rw-rw-rw-) NPERM=666
		;;
		rwx------) NPERM=700
		;;
		rwx--x---) NPERM=710
		;;
		rwx--x--x) NPERM=711
		;;
		rwxr-x--x) NPERM=750
		;;
		rwxr-xr-x) NPERM=755
		;;
		rwxrwxrvx) NPERM=777
		;;
esac
echo $NPERM
}
#end func declare
#funny start here
OLD_IFS=$IFS
IFS='
'
for i in $(ls -lh | grep -v total); do
	echo $(echo $i |cut -c -1)\
	$( LetterToNums $(echo $i |cut -c 2-  | cut -c -9 ) )\
	$(echo $i |cut -c 12-)
     done 
IFS=$OLD_IFS
#funny stop here
pierluigi