#!/bin/rc rfork e usage='usage: chown owner file ... owner is user or user:group or user: or :group ' if(~ $#* 0 1){ echo $usage exit } o=$1 shift ug=`{echo $o | tr : ' '} switch($o){ case ?*:?* /bin/chgrp -u $ug(1) $* /bin/chgrp $ug(2) $* case ?*: /bin/chgrp -u $ug(1) $* case :?* /bin/chgrp $ug(1) $* case : echo $usage case * /bin/chgrp -u $ug(1) $* }