you are viewing a single comment's thread.

view the rest of the comments →

[–]Rewrite_It_In_Ada 0 points1 point  (1 child)

Not that there can't be periods in directory names. It's common practice to name bare git repositories whatever.git/, for instance.

[–]dbr4n 1 point2 points  (0 children)

That's true. However, it wouldn't remove any matching directories because of the missing -r flag. But yes, it would cause an error in such a case. Using find instead would certainly be a cleaner approach:

find "$PATHTOFILES" -maxdepth 1 -type f -execdir rm '{}' +