#!/bin/ksh # admin@wickedmind.com # Script to chk multiple home directories. # # Chk the /etc/passwd for dup entries. # PW_FILE=/etc/passwd #point to passwd file DUP_FILE=tempdup.$$ #egrep search set echo The following login accounts use the same home dirs as other accounts: cut -d: -f6 $PW_FILE | sort | uniq -c | egrep -v " 1 " | sed -e 's/ *[1-9]* //' -e 's/\(.*\)/:\1:/' > $DUP_FILE egrep -f $DUP_FILE $PW_FILE | cut -d: -f1,6 | sort -t: +1 | tr ':' ' ' #2nd Argument has only 1 tab rm $DUP_FILE