source: projects/setup/trunk/uidgidlint @ 8718

Revision 8718, 715 bytes checked in by daisuke, 10 years ago (diff)

update to 2.9.0

  • Property svn:executable set to *
RevLine 
[8717]1#!/bin/sh
2# We need a file to look at.
3if [ -z "$*" ] ; then
4        echo Usage: `basename $0` uidgid
5        exit 1
6fi
[8718]7error=0
[8717]8# The format of the file is (currently)
9for infile in "$@" ; do
10        uidlist=`tail -n +2 "$infile" | awk '{print $2}' | grep -v '?' | grep -v -e - | sort -nu`
11        gidlist=`tail -n +2 "$infile" | awk '{print $3}' | grep -v '?' | grep -v -e - | sort -nu`
12        for uid in $uidlist ; do
13                if test `tail -n +2 "$infile" | awk '{print $2}' | grep '^'"$uid"'$' | wc -l` -ne 1 ; then
14                        echo Duplicate UID: $uid
[8718]15                        error=1
[8717]16                fi
17        done
18        for gid in $gidlist ; do
[8718]19                if test `tail -n +2 "$infile" | awk '{print $3}' | grep '^'"$gid"'$' | wc -l` -ne 1 ; then
[8717]20                        echo Duplicate GID: $gid
[8718]21                        error=1
[8717]22                fi
23        done
24done
[8718]25exit $error
Note: See TracBrowser for help on using the repository browser.