我需要添加功能以输出找到字符串的整行。所以这是我到目前为止工作的代码。
if type == "asa"
if File.readlines(file).grep(/http server enabled/).any?
$httpserver_failures.push(file)
out.puts "FAILED: does have http enabled"
else
$httpserver_passes.push(file)
out.puts "PASSED: does not have http enabled"
end
elsif type == "ios"
if File.readlines(file).grep(/no ip http server/).any?
$httpserver_failures.push(file)
out.puts "FAILED: does have http enabled"
else
$httpserver_passes.push(file)
out.puts "PASSED: does not have http enabled"
end
end
所以我只需要添加一行来输出找到的行。我只是不知道语法。
谢谢