I’ve below lines in one of my startup scripts (abc.sh):
runuser root -c "export CATALINA_OPTS=\"-Xms5g -Xmx10g\"; \
nohup $CATALINA_HOME/bin/startup.sh $CATALINA_HOME > /dev/null &"
I want to replace -Xms5g -Xmx10g with below line:
-Xms500m -Xmx1g -Xrunjdwp:transport=dt_socket,address=9000,server=y,suspend=n
I wrote a script myscript.sh which contains below code:
#!/bin/bash
sed -i~ 's/-Xms5g -Xmx10g/-Xms500m \
-Xmx1g -Xrunjdwp:transport=dt_socket,address=9000,server=y,suspend=n' ./abc.sh
But its giving me error:
sed: -e expression #1, char 95: unterminated `s' command
Can any one help me out in correcting this command?
Note: There are other several lines as well in abc.sh
Thanks!
You failed to add a
/at the end.Pattern should be like this:
s/regexp/replacement/