summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>2000-08-09 09:23:30 +0000
committerBrian Somers <brian@FreeBSD.org>2000-08-09 09:23:30 +0000
commit3ebdf3366d1e4bd501df575071acfb4fca134235 (patch)
tree49ac93fa6d20daceb729f789b9197ad11f2be0fa
parent0edeb3dc90c1121dea6dcf7d1563e0256e9fb487 (diff)
Notes
-rw-r--r--etc/rc8
1 files changed, 5 insertions, 3 deletions
diff --git a/etc/rc b/etc/rc
index 360bc86b5434..efa5ecf30cd8 100644
--- a/etc/rc
+++ b/etc/rc
@@ -165,10 +165,12 @@ purgedir() {
for dir
do
(
- cd "$dir" && ls | while read file
+ cd "$dir" && for file in .* *
do
- [ -d "$file" ] && purgedir "$file"
- [ -f "$file" ] && rm -f "$file"
+ [ ."$file" = .. -o ."$file" = ... ] && continue
+ [ -d "$file" -a ! -L "$file" ] &&
+ purgedir "$file"
+ [ -f "$file" ] && rm -f -- "$file"
done
)
done