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

Alan Sparks als at roxanne.mlb.semi.harris.com
Sat Jul 28 05:48:00 AEST 1990


In article <19253 at well.sf.ca.us> whofan at 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`



More information about the Comp.unix.xenix mailing list