Hi Guys,
I am have a yaml file and it has the following text:
Code:
/data/app0:
server: x.y.z.p
share: /data/app0
mount: /data/app/0
And I want to have the following output:
Code:
/data/app0:
server: x.y.z.p
share: /data/app0
mount: /data/app/0
options: _netdev,noatime,nodiratime
I tried the following which is a simple regex expression used -i and a but it is throwing an error:
Code:
[user@jump nodes]$ cat test.yaml
/data/app0:
server: x.y.z.p
share: /data/app0
mount: /data/apps/0
/data/app1:
server: x.y.z.p
share: /data/app1
mount: /data/apps/1
/data/app2:
server: x.y.z.p
share: /data/app2
mount: /data/apps/2
/data/app3:
server: x.y.z.p
share: /data/app3
mount: /data/apps/3
[user@jump nodes]$ sed -i '/mount: /data/app/*/a \
options: _netdev,noatime,nodiratime \' test.yaml
sed: -e expression #1, char 11: extra characters after command
[user@jump nodes]$
No idea why it is going wrong ?