Skip to content
Browse files

Now expands glob patterns of files to delete.

  • Loading branch information...
1 parent c8c03bd commit 669f5a8429c66fecefeba2f8a5205528368fd3cc jgdavidson committed Aug 19, 2005
Showing with 8 additions and 6 deletions.
  1. +8 −6 util/nsremove.tcl
View
14 util/nsremove.tcl
@@ -33,16 +33,18 @@
# Remove one or more files.
#
# Usage:
-# nsremove.tcl file ?file ...?
+# nsremove.tcl pattern ?pattern ...?
#
# Where:
-# file File to remove.
+# pattern Glob-style pattern of files to remove.
#
-foreach f $argv {
- if [file exists $f] {
- file delete $f
- puts "removed: $f"
+foreach pattern $argv {
+ foreach file [glob -nocomplain $pattern] {
+ if [file exists $file] {
+ file delete $file
+ puts "removed: $file"
+ }
}
}

0 comments on commit 669f5a8

Please sign in to comment.
Something went wrong with that request. Please try again.