0

I need to find a word and replace to some other, but its works for me

Edit.sh:

#! /bin/sh
file=kibana.yml
addr="   192.168.1.101"
sed -i -s -e "s/\(server.host:\).*/\1$addr/" $file
elaurl="http://192.168.1.100:9200"
sed -i -s -e "s/\(elasticsearch.url:\)/*/.*/\1$elaurl/"  $file

kibana.yml:

# The host to bind the server to.
   server.host:   192.168.1.101

# If you are running kibana behind a proxy, and want to mount it at a path,
# specify that path here. The basePath can't end in a slash.
# server.basePath: ""

# The maximum payload size in bytes on incoming server requests.
# server.maxPayloadBytes: 1048576

# The Elasticsearch instance to use for all your queries.
  elasticsearch.url: http://10.1.2.19:9200

But, if I try only replace server.host: its works fine, but add next one(elasticsearch.url:) line then throw error:

  sed: -e expression #1, char 28: unknown option to `s'

Suggest me How to fix this issue

Rajkumar .E
  • 1,440
  • 3
  • 20
  • 34

0 Answers0