Paste Search Dynamic
Recent pastes
define service
  1. #!/bin/bash
  2. s="define service{
  3.    host_name               A
  4.    notification_period     F
  5.    }
  6.  
  7.  
  8.    define service{
  9.    host_name               A
  10.    notification_period     metrologie
  11.    notification_period     F
  12. }"
  13.  
  14. sed '/metrologie/{n;/.*notification_period/{s/n.*//}}' <<< "$s"
Parsed in 0.003 seconds