views:

61

answers:

1

What is the shortest way I can write:

rm -rfv public/stylesheets public/images public/javascripts

and make it conditional, with something like:

if [ ! -d public/stylesheets ]; then rm -rfv public/stylesheets; fi ...

Just discovered/found a use for command-line conditionals :)

+3  A: 
for i in public/{stylesheet,image,javascript}s; do [ -d $i ] || rm -rfv $i; done
ephemient
nice use of globbing
glenn jackman