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
Post a Comment