Hi I'm looking for a script that searches through multiple files for a string and the line where this string is found should be moved three lines down, for example:
Code:
define service{
use generic-service
host_name server1
service_description check_backup
check_command check_backup ; The command used to monitor the service
servicegroups check_mysqlbackup
}
now what I want is for each time the script finds "host_name " it should move this complete line three rows down like this:
Code:
define service{
use generic-service
service_description check_backup
check_command check_backup ; The command used to monitor the service
servicegroups check_mysqlbackup
host_name server1
}
I have hundreds of these files and each file have host_name in it multiple time, I would be truly greatful if this could be automated somehow. Thanks in advance!