[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Special requirements for scripts in /etc/rcS.d?



Frank Küster wrote:
> stat is called to get uid and exact permissions of a temporary
> configuration file which has just been created.

Perl is standard on systems.  I hesitate to put more use of it in init
scripts but...  Perhaps this would be of use instead of stat just to
work around this problem?

  perl -e 'printf("%d\n",(stat($ARGV[0]))[4]);' /tmp # print uid in decimal
  0
  perl -e 'printf("%o\n",(stat($ARGV[0]))[2]);' /tmp # print mode in octal
  41777

My only question now is where did that '4' come from in the mode?  But
the last four digits always seem to be correct.

Bob

Attachment: pgpbrEpy9JRMf.pgp
Description: PGP signature


Reply to: