Article Figure 1 Figure 2 Listing 1 Listing 2
Listing 3 Listing 4 Listing 5 Listing 6 Listing 7
Listing 8 Listing 9 Listing 10 Listing 11 Listing 12
Listing 13 Listing 14 may94.tar

Listing 11: prog7

:
#######################################################
# prog7 - list all files with unknown user or group id
#######################################################
# use awk to determine if either of the fields begin
# with a number.

# see also mklist
masterlist=/usr/stevei/c/stat/master.list

cat $masterlist |
awk '/^[lbcd]/ { next } # skip special files
{
#_begin template for stat args: -oidlugpsanw
# mode inum device [idnum] links uid gid fsize day
# month dayofmonth time year [access] fname

mode=$1
inum=$2
device=$3

# the [constructed] idnum must be used when scanning
# multiple file systems in order to uniquely
# identify the file.
idnum=sprintf("%s %s", inum, device)

links=$4
uid=$5
gid=$6
fsize=$7

day=$8
month=$9
dayofmonth=$10
time=$11
year=$12
# access=sprintf("%s %s %s %s %s",
#    day, month, dayofmonth, time, year)

fname=$13
#_end template

if ( uid ~ /[0-9].*/ || gid ~ /[0-9].*/ )
print
}'
exit 0