hello,
my current solution bases on a map file (generated maybe not in "elegant" way)...
and I am looking for something quicker or more natural way to check it in a UNIX directly on file, - a command which can return file modes in octal instead of .rwx..... form
regards
my current solution bases on a map file (generated maybe not in "elegant" way)...
Code:
# a=0 b=0 c=0 d=0;until [ $a -eq 8 ];do until [ $b -eq 8 ]; do until [ $c -eq 8 ];do until [ $d -eq 8 ];do touch ${a}${b}${c}${d};chmod ${a}${b}${c}${d} ${a}${b}${c}${d};ls -ld ${a}${b}${c}${d}|awk '{print $1,$NF}';rm ${a}${b}${c}${d};((d+=1));done;d=0;((c+=1));done;c=0;((b+=1));done;b=0;((a+=1));done >mapa.permissionow
# wc mapa.permissionow
4096 8192 65536 mapa.permissionow
# ls -ld /tmp
drwxrwxrwt 14 bin bin 20480 Feb 14 16:25 /tmp
# grep ^.rwxrwxrwt mapa.permissionow|cut -d" " -f2
1777
#
and I am looking for something quicker or more natural way to check it in a UNIX directly on file, - a command which can return file modes in octal instead of .rwx..... form
regards