I try to capture those blocks of strings and comment on them using regexp and sed. each block separated with space
some text here
some text here
AppServer1:
name: ${AppServer1.name}
ip: ${AppServer1.ip}
some text here
some text here
AppServer2:
name: ${AppServer1.name}
ip: ${AppServer1.ip}
some text here
some text here
I try with this regexp:
sed E '/./{H;1h;$!d} ; x ; s/[^\$AppServer1](AppServer1)/#\1/gi'
but the result is :
#AppServer1:
name: $#{AppServer1.name}
ip: $#{AppServer1.ip}
what im missing here to comment the full string to be :
#AppServer1:
# name: ${AppServer1.name}
# ip: ${AppServer1.ip}