> However, a new question arises. Will this work in all cases:
>
> rmdir $LDIR 2>/dev/null && grep -v $LDIR $LDSOCONF >$tmpfile && mv $tmpfile
> $LDSOCONF || true
> rm $tempfile # just in case the mv failed, or grep failed partly
>
> Or is there any trap door I miss?
What if you have a directory LDIR=/etc/foo/bar but there is another
directory called /etc/foo/barbar in $LDSOCONF? Maybe you should
change the grep command to:
grep -v "^$LDIR\$" $LDSOCONF
so that you match the entire line.
Julian
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Julian Gilbey Email: [EMAIL PROTECTED]
Dept of Mathematical Sciences, Queen Mary & Westfield College,
Mile End Road, London E1 4NS, ENGLAND
-*- Finger [EMAIL PROTECTED] for my PGP public key. -*-