The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 04-12-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
Code:
for d in dir/*/.; do
  rmdir "${d%/.}"
done
This may require minor modifications. ${var%suf} means remove "suf" from the value of $var -- try it with echo instead of rmdir to see what it does, and whether it's suitable for you.
Reply With Quote