From harpo!eagle!mhuxt!mhuxj!mhuxa!houxm!ihnp4!ixn5c!inuxc!pur-ee!uiucdcs!adams Fri Apr 22 22:39:05 1983
Subject: chall, recursive chown, chgrp - (nf)
Newsgroups: net.sources

#N:uiucdcs:12600008:000:8218
uiucdcs!adams    Apr 22 17:58:00 1983


	What follows is the source and man page (in a Bourne RunMe script)
for chall, a recursive chown/chgrp.  Syntax is as follows:

% chall owner group dir1 dir2 ...
E.g.,
% chall uucp bin /usr/lib/uucp /usr/spool/uucp

	The example appropriately changes the ownership (and group ownship)
of /usr/lib/uucp, /usr/spool/uucp and all of their descendants.

	For more info, read the man page.

	Instructions:
		Save this in a file, and get rid of this
		garbage at top

		type /bin/sh RunMe

		type make chall

	Known lacks:
		Reading the directory could be more efficient. 
		(E.g. I could use 4.1aBSD's directory readers, which
		has the side effect of making this work for 4.1c)
		N.b. I don't know if this will work on 4.1c.

		Error recovery is less than gracious.  If ANYTHING goes
		wrong, chall just dies (by design).  I prolly ought
		to have it continue its task.

		It has only been tested on 4.1,4.1aBSD, and one hybrid
		UNIX running on a Cadlinc Sun 68000.  If it does
		not port easily to your machine, please let me know.

		I have one open file for every directory level.  This means
		that you may only go (NOFILE -3) levels deep.  On my machine
		this means I can get to *almost* everything if I execute
		%chall adams bin /   (No, I didn't try it...)

	RCS:
		I use purdue's RCS (Revision Control System), and it
		has left its mark in my code.  To get RCS, contact
		purdue!wft  or Tichy@purdue.

	Distribution:
		I don't care where it goes, but don't sell it, and if
		you find any bugs (in my code?), let me know.


					Rob Adams
					(217) 333 3536
					uiucdcs!adams
	By the way:
		There is a reason I don't just use find(1).  This
		runs (seriously) 100 times as fast.  Really.

