Code:
#!/bin/ksh
if [ -f existentFiles ]
then
rm existentFiles
fi
for a in /etc/magic /sbin/fsck /boot/grub/menu.lst /usr/share/games/wombat /var/cache/man/index.db /usr/bin/defcon
do
if ( ls $a > /dev/null 2>&1 )
then
echo $a >> existentFiles
fi
done
On my Mandrake box (using /bin/bash as the first line) I get:
Code:
$ cat existentFiles
/sbin/fsck
On my OpenBSD box (using /bin/ksh as the first line) I get:
Code:
$ cat existentFiles
/etc/magic
/sbin/fsck
Carl
|