更新时间:2023-02-20 10:52:01
您不能同时处于多个cwd
中.要为每个与模式匹配的目录运行命令,可以使用Dir#glob
:
You can't be in multiple cwd
s simultaneously. To run the command for each directory that matches the pattern, you can use Dir#glob
:
Dir.glob('/var/cache/acpchef/src/ap-kernelmodule-10*').each do |cwd|
Mixlib::ShellOut.new("command run here", cwd: cwd).run_command
end