linux shell sed practise
use sed to implement change some text from the specify file, like as#! /bin/Bashsetting_file=/cydrive/c/dev/maven/setting.xml.txtpattern="<db.user>*<\/db.user>"target="<db.user>_35<\/db.user>"sed -n -i -e 1,6s/$pattern/$target "$setting_file"
modify the properties file by the such way:
tmp_file=/tmp/tmpfile.$$schema=$1user="owner_"$schemapassword="owner_"$schema"_XXXXX"cp local.properties $tmp_filesed -i -e s/app.local.usr=.*/app.local.usr=$user/ "$tmp_file"sed -i -e s/app.local.password=.*/app.local.password=$password/ "$tmp_file"mv $tmp_file local.properties
页:
[1]