regex - sed replace content within double quotes -


i need replace versionname in xml file shell script using sed.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     package="com.example.sed"     android:versioncode="1"     android:versionname="unknown version name"> 

i've gotten far search line containing versionname how tell sed replace within double quotes coming directly after versionname?

sed -i .old '/versionname/ s/what write?/new version name/' androidmanifest.xml 

replace not-", this:

sed -i .old '/android:versionname/ s/="[^"][^"]*"/="new version name"/' androidmanifest.xml 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -