I have the following script:
originalLine='<com.whatsapp.voipcalling.VideoCallParticipantViewLayout android:id="@id/video_participant_views" android:layout_width="fill_parent" android:layout_height="fill_parent"/>'
escParamToChange="android:layout_width"
value="10dip"
replacementLine=$(echo ${originalLine} | sed -E 's/'${escParamToChange}'=[^ ]*/'${escParamToChange}'="'${value}'"/')
echo ${replacementLine}
I'm trying to replace the value of the "android:layout_width" to "10dip".
It works fine and the output is:
<com.whatsapp.voipcalling.VideoCallParticipantViewLayout android:id="@id/video_participant_views" android:layout_width="10dip" android:layout_height="fill_parent"/>
But when i change the "escParamToChange" to "android:layout_height", this is the output i get:
<com.whatsapp.voipcalling.VideoCallParticipantViewLayout android:id="@id/video_participant_views" android:layout_width="fill_parent" android:layout_height="10dip"
The last "/>" is being removed as well.
What should i change to get it to work?
Thanks