1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/tool/rmdirs

12 lines
237 B
Text
Raw Normal View History

#!/bin/sh
for dir do
while rmdir "$dir" >/dev/null 2>&1 &&
parent=`expr "$dir" : '\(.*\)/[^/][^/]*'`; do
case "$parent" in
. | .. | "$dir") break;;
*) dir="$parent";;
esac
done
done
true