-2
我想在多个文件中的现有字符串周围添加双引号。在多个文件中的现有字符串周围添加引号
check_envurl!ma100mlpapl002!-p 8080!-u/apollo/info?section = ERROR !!!!!
我想在第一个“-u”之后但在和之前添加一个报价!所以它会是
check_envurl!ma100mlpapl002!-p 8080!-u“/ apollo/info?section = ERROR”!!!!!
我试过用sed替换,但不符合标准
define service {
host_name ma100mlpapl002
servicegroups Environment URL
service_description http://ma100mlpapl002:8080/apollo/info?section=ERROR
display_name http://ma100mlpapl002:8080/apollo/info?section=ERROR
check_command check_envurl!ma100mlpapl002!-p 8080!-u /apollo/info?section=ERROR!!!!!
max_check_attempts 3
check_interval 15
retry_interval 1
check_period 24x7
contact_groups siteops
sed '/pattern/a some text here' filename
Thxs Kenavoz,这个奇妙的工作 –