I gone through the script echo 'rwxrwxrw-' | perl -ne 'BEGIN{sub conv{ chomp(my $ins=shift); my $k=0; for(my $i=0;$i<=8;$i++) { my $tmps = ( substr($ins, $i, 1) =~ /[rwx]/ ); $k+= ( $tmps*(2**(8-$i)) ); }; if ($k) { sprintf( %0o , $k); } else { ?? ; }; }; } print(conv($_).\n);'It's really wonderful but its missing extra permissions like sticky bit, suid, sgid. I will me more appreciated, if you could include them in the script.
Is there a shell script converter between rwx/rwt etc and the octal version?
shell;shell script