source: projects/setup/trunk/uidgidlint @ 8717

Revision 8717, 700 bytes checked in by daisuke, 8 years ago (diff)

add initial version

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