using /usr/bin/cut in scripts...

Brian Lawrence Dear whofan at well.sf.ca.us
Sat Jul 28 04:15:48 AEST 1990



 
 
The following is a portion of an installation script.  This portion
reads the /etc/group file, figures out what's the next available
group ID, and then creates a new group and assigns it that next
available ID number:
 
          gid=`/usr/bin/cut -f3 -d: /etc/group|sort -n|tail -1`
          gid=`eval $gid + 1`
          echo "mygroup::$gid:user1,user2,usern" >> /etc/group
 
Thing is, the /usr/bin/cut command is not available on everyone's
SCO XENIX machine.  /usr/bin/cut gets installed if you install
the SCO Text Processing stuff.
 
So.. my question is, is there an alternative to the script
above that I can use and rest assured it'll work on all SCO
XENIX 386 platforms, to add a new group as described?
 
-- brian dear
   coconut computing, inc.

Please respond via e-mail to ..!ucsd!coconet!brian



More information about the Comp.unix.wizards mailing list