19 Jul
2001
19 Jul
'01
4:50 a.m.
On Thu, 19 Jul 2001 ccb@acm.org wrote:
Check out the 'stat' command and 'stat -t'.
Unfortunately it gives full modes in HEX!
Oh, that's what that was. Without the -t looked promising, but with the -t I couldn't find the value I expected. Thank you anyway Charles.
Some shell hackery: set -- $(ls -l foo) OCTMODE=$(echo "ibase=2;obase=8;$(echo $1 | tr -- '-drlwcxb' '0 1 1 1 ')" | bc)
Indeed, many thanks. My script was going to be something along the lines of awk/if-then-else-fi/echo. :-) Can this be tweaked for directories also? You lost me after tr. -- Gary