One of the parameter into the property file is JAVA_HOME=/var/tmp/java/jdk1.x.x
planning to remove entire line of JAVA_HOME and add the new JAVA_HOME=/var/tmp/java/jdk11.0.5
into the same like of the property file using SED command.
ex:Remove the line 3 and add the JAVA_HOME=/var/tmp/java/jdk11.0.5
into the same location line 3.
#!/bin/sh
export ORACLE_HOME=/opt/ibm/oracle
export JAVA_HOME=/var/tmp/java/java1.8.0.31
CodePudding user response:
Backup the original file and try this sed
command:
sed -i 's%JAVA_HOME=.*%JAVA_HOME=/var/tmp/java/jdk11.0.5%' file