spring.datasource.jndi-name=java:/jdbc/ph20guib
我想使用sed命令将上面的行替换为下面的行
spring.datasource.jndi-name=java:/comp/env/jdbc/ph20guib
答案 0 :(得分:0)
假设属性文件的名称为file.txt,则可以使用以下命令:
$ sed -i 's/\/jdbc\/ph20guib/\/comp\/env\/jdbc\/ph20guib/g' file.txt
答案 1 :(得分:0)
您可以使用sed as轻松替换它
=================<JSON RESPONSE>=================
{"groupID":"6","groupName":"Test","teacher":"Teacher1"
,"teacherID":"13","Locations":
[{"locationID":"5","locationName":"field"},
{"locationID":"6","locationName":"34th"}],"Error":""}
=================</JSON RESPONSE/>=================
Entering LocJSON Loop
=================<LOCJSON >=================
GNAME:
TID:
Locjson.stringalue:
=================</LOCJSON/>=================