Groups
Groups
Sign in
Groups
Groups
comp.lang.tcl
Conversations
About
Send feedback
Help
Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss
Learn more
TCL Command to delete multiple Directories
544 views
Skip to first unread message
gpa...@gmail.com
unread,
Sep 3, 2020, 8:39:34 AM
9/3/20
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I have to delete all 100 folders (namely run_000 to run_100 ) created by the project flow
Following command in a shell script removes the folders properly
\rm -rf ./product/p_1.results/run_*
How can i implement the same in a TCL script ?
Thanks in Advance
Parth
Ted Nolan <tednolan>
unread,
Sep 3, 2020, 9:24:20 AM
9/3/20
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
In article <
5cc323eb-df94-4d0c...@googlegroups.com
>,
Well, you could just exec the same Unix "rm -rf" command from Tcl.
Failing that, the Tcl "file delete -force" command should do what you want.
--
columbiaclosings.com
What's not in Columbia anymore..
Rich
unread,
Sep 3, 2020, 9:58:32 AM
9/3/20
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
The Tcl equivalent of your rm command above is:
file delete -force -- {*}[glob -nocomplain ./product/p_1.results/run_*]
Robert Heller
unread,
Sep 3, 2020, 9:58:46 AM
9/3/20
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
foreach dir [glob -nocomplain ./product/p_1.results/run_*] {
file delete -force $dir
}
man n glob
man n file
>
> Thanks in Advance
> Parth
>
>
--
Robert Heller -- Cell:
413-658-7953
GV:
978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/
-- Linux Administration Services
hel...@deepsoft.com
-- Webhosting Services
greg
unread,
Sep 3, 2020, 1:05:00 PM
9/3/20
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
from tcllib
fileutil::multi::op - Multi-file operation, scatter/gather
https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/modules/fileutil/multiop.md
Example (linux):
mkdir /tmp/backup/1
mkdir /tmp/backup/2
mkdir /tmp/backup/3
package require fileutil::multi::op
fileutil::multi::op tmpdel
tmpdel do remove the ? in /tmp/backup
Gregor
greg
unread,
Sep 3, 2020, 1:27:52 PM
9/3/20
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Am Donnerstag, 3. September 2020 14:39:34 UTC+2 schrieb
gpa...@gmail.com
:
#Example
package require fileutil::multi::op
fileutil::multi::op tmpdel
tmpdel do remove the run_* in ./product/p_1.results/
greg
unread,
Sep 3, 2020, 3:00:54 PM
9/3/20
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
links:
file delete
http://www.tcl.tk/man/tcl/TclCmd/file.htm#M12
https://wiki.tcl-lang.org/page/file+delete
glob
https://wiki.tcl-lang.org/page/glob
https://www.tcl-lang.org/man/tcl/TclCmd/glob.htm
{*}
https://wiki.tcl-lang.org/page/%7B*%7D
https://www.tcl-lang.org/man/tcl/TclCmd/Tcl.htm
fileutil::multi::op
https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/modules/fileutil/multiop.md
https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/modules/fileutil/multi.md
0 new messages