William James wrote:
> James B. Byrne wrote:
>
> > # find, move and optionally rename data files that match glob expression
> > # provided.
> > #
> > # ruby mv2dir.rb source_dir glob_exp [target_dir=./] [ext]
>
> # ruby mv2dir.rb source_dir glob_exp target_dir
> require 'fileutils'
> Dir[ File.join(ARGV[0], "*") ].select{ |p|
>   Regexp.new(ARGV[1]).match File.basename( p ) }.each{ |p|
>   FileUtils.move( p, ARGV[2] ) }

Please pardon previous prolixity.

require 'fileutils'
FileUtils.move Dir[ File.join(ARGV[0], "*") ].select{ |p|
  Regexp.new(ARGV[1]).match File.basename( p ) }, ARGV[2]