Xref: utzoo comp.unix.wizards:23155 comp.unix.i386:7328 comp.unix.xenix:12590 Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!zaphod.mps.ohio-state.edu!rpi!sci.ccny.cuny.edu!phri!marob!daveh From: daveh@marob.masa.com (Dave Hammond) Newsgroups: comp.unix.wizards,comp.unix.i386,comp.unix.xenix Subject: Re: using /usr/bin/cut in scripts... Keywords: cut, shell scripts Message-ID: <26B24140.4F3@marob.masa.com> Date: 29 Jul 90 01:51:59 GMT References: <19253@well.sf.ca.us> Reply-To: daveh@marob.masa.com (Dave Hammond) Organization: ESCC, New York City Lines: 24 In article <19253@well.sf.ca.us> Brian Lawrence Dear writes: > > gid=`/usr/bin/cut -f3 -d: /etc/group|sort -n|tail -1` > >Thing is, the /usr/bin/cut command is not available on everyone's >SCO XENIX machine.[...] > >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? One alternative is awk. Replace "/usr/bin/cut -f3 -d:" with "awk -F: '{print $3}'": gid=`awk -F: '{print $3}' /etc/group|sort -n|tail -1` Another alternative is to get the public domain version of cut from your local comp.sources archive. -- Dave Hammond daveh@marob.masa.com uunet!masa.com!marob!daveh