On Fri, Aug 24, 2012 at 4:59 AM, Jim Weirich <[email protected]> wrote:
> Thomas Luedeke wrote in post #1073026:
>> [...] How the heck do I delete the middle two directories, once I have
>> strings
>> set as:
>>
>> job1 = 97504
>> job2 = 98537
>>
>> This is embarrassing....
>
> Would something like this work for you:
>
> require 'fileutils'
> job = ARGV.shift.to_i
>
> dir_pattern = "Eb%05d.*" % job
> Dir[dir_pattern].each do |dir_name|
> puts "Deleting #{dir_name}"
> FileUtils.rm_r dir_name
> end
I offer
require 'fileutils'
FileUtils.rm_r Dir[*ARGV.map {|job| "base/Eb#{job}.*"}]
Kind regards
robert
--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
[email protected]. To unsubscribe from this group, send email
to [email protected]. For more options, visit this
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en