Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 Ruby 中执行以下操作:
cat </dirpath/file.*> | grep <pattern> | grep <pattern2> | cut <options> > <path>/output.txt
Dir.grep("/dirpath/file.*") .map{|f| File.read(f)} .join($/) .grep(pattern) .grep(pattern2) .slice(options) .tap{|s| File.write("path/output.txt", s)}