Solaris command to find permission in octal value

           In a shell script that I wrote some time back, I need to change the permission of an executable and then revert it back when the script ends. I decided to do this in using “chmod” command. But the problem arises when I need to find the permission value in octal. “ls –l” gives the permission in rwx format.  So I raised a query in sun forums, luckily I got reply from wrobbins2 explaining about the “pkgproto” command which does the work perfectly,

  Usage: /usr/bin/pkgproto filename

Thanks wrobbins !!



2 Responses

  1. stat -c %a

  2. Thanks Tom !! However, stat is not a standard package with Solaris, it mandates us to install GNU coreutils !!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: