[SM-Grimoire-Bugs] [Bug 10509] init.d: delete stale pid files at boot

bugzilla-daemon at bugs.sourcemage.org bugzilla-daemon at bugs.sourcemage.org
Sat Feb 25 05:42:13 EST 2006


http://bugs.sourcemage.org/show_bug.cgi?id=10509





------- Additional Comments From v.merkatz at gmx.net  2006-02-25 04:42 -------
Here's the one I just wrote when you mentioned it on irc:
function recursive_rm() {
  cd  "$1"
    for i in *; do
      if test -d "$i"; then
        recursive_rm "$i"
      elif test -f "$i"; then
        rm "$i";
      fi
    done
  cd ..
}

This only removes regular files, not sure if there's more to check for (named
pipes, symlinks, ...). As everything except 'rm' is bash builtin it's quite fast
(just replace the rm by echo and run it on a big dir > /dev/null to see).

-- 
Configure bugmail: http://bugs.sourcemage.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the SM-Grimoire-Bugs mailing list