unix - Replace a value of a parameter in a file from Bash Script -


i have pair in configuration file:

theparameter="thevalue" 

i trying replace thevalue bash script like, no luck.

sed 's/theparameter="(.*)"/theparameter="newvalue"/' /etc/my.conf  

can suggest correct way?

see example:

kent$  echo 'theparameter="thevalue"'|sed 's/\(theparameter="\).*/\1newvalue"/' theparameter="newvalue" 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

php - Dynamic url re-writing using htaccess -

java - Multi-Label Document Classification -