Xref: utzoo comp.unix.wizards:23128 comp.unix.i386:7283 comp.unix.xenix:12575 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uflorida!mlb.semi.harris.com!roxanne.mlb.semi.harris.com!als From: als@roxanne.mlb.semi.harris.com (Alan Sparks) Newsgroups: comp.unix.wizards,comp.unix.i386,comp.unix.xenix Subject: Re: using /usr/bin/cut in scripts... Keywords: cut, shell scripts Message-ID: <1990Jul27.194800.11453@mlb.semi.harris.com> Date: 27 Jul 90 19:48:00 GMT References: <19253@well.sf.ca.us> Sender: news@mlb.semi.harris.com Distribution: usa Organization: Harris Semiconductor, Melbourne FL Lines: 16 In article <19253@well.sf.ca.us> whofan@well.sf.ca.us (Brian Lawrence Dear) writes: > >The following is a portion of an installation script. This portion [deleted] > 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 [deleted]> >So.. my question is, is there an alternative to the script [deleted] Might I suggest replacing the first line with: gid=`/bin/awk -F: '{print $3}' etc/group|sort -n|tail -1`