Fixdisk strangeness

John McMillan jcm at mtune.ATT.COM
Tue Feb 6 09:23:52 AEST 1990


In article <25508 at gryphon.COM> ttg at gryphon.COM (Ted Garrett) writes:
>I noticed today that a function in my .kshrc is no longer functional.  The
>basis of it is :
>
>if [ -w /etc/cron ]
>then
>   ROOT=" root "
>else
>   ROOT=""
>fi
:
>So while this is a correction of a 'bug' in the ksh permissions checking, it's
>inconvenient in that I had to search out a file on my system which is actually
>owned by root and is read/write only by root.  I used /etc/group.
>
>No biggie, but it may change the way some things get done on your system.


	What puzzles me, more than the permissions change,
	is why you're not doing something like:

		ROOT=" `expr \"\`id\`\" : '[^(]*(\([^)]*\))'`"
		if [ " root" != "$ROOT" ] ; then ROOT="" ; fi
	
	I may well be missing some point of your script, but it
	seems you're working overly hard to avoid the direct test.

john mcmillan -- att!mtune!jcm -- juzz muttering for self, not THEM



More information about the Unix-pc.general mailing list