#!/bin/sh
#
#     tiger - A UN*X security checking system
#     Copyright (C) 1993 Douglas Lee Schales, David K. Hess, David R. Safford
#
#     Please see the file `COPYING' for the complete copyright notice.
#
# syslist - 06/14/93
#
#-----------------------------------------------------------------------------
#

findcmd()
{
    CMD=$1

    SRCH=/usr/bin:/bin:/usr/ucb:/etc:/usr/etc:/usr/sbin:/sbin

    SAVEIFS=$IFS
    IFS=:
    set $SRCH
    IFS=$SAVEIFS
    for dir
    do
       [ ! -d $dir/$CMD -a -f $dir/$CMD ] && {
            echo $dir/$CMD
            return
       }
    done
# Try PATH
    IFS=:
    set $PATH
    IFS=$SAVEIFS
    for dir
    do
       [ ! -d $dir/$CMD -a -f $dir/$CMD ] && {
            echo $dir/$CMD
            return
       }
    done
    echo "'$CMD' not in $SRCH:$PATH" 1>&2
}

FIND=`findcmd find`
SED=`findcmd sed`
GREP=`findcmd grep`
SORT=`findcmd sort`
AWK=`findcmd awk`

[ "$FIND" = "" -o "$SED" = "" -o "$GREP" = "" -o \
	"$SORT" = "" -o "$AWK" = "" ] && exit 1


$FIND systems -name config -print |
$SED -e 's/^systems//' -e 's%/config$%%' -e 's%^/%%' -e '/^$/d' |
$GREP -v default |
$SORT |
$SED -e 's/\// /g' |
$AWK '{ if(NF > 2){
           printf("%s ", $1);
           for(i=3;i<=NF;i++)
              printf("%s ", $i);
           printf("\n");
        }
        else
           print;
      }'

