I'm trying to replace a number in a unity file for my automated build process. I've tried different versions of the regexp, as well as commands, however none seem to work correct. I currently have
perl -0777 -ne 'print "${1}0" while /(WebGLSupport\s+m_APIs:\s[a-b0-9]{8,16}\s+m_Automatic\:\s)1/sg' ../../CityBotVRSimWebGL/HandTracking/ProjectSettings/ProjectSettings.asset
which correctly prints and replaces the '1'
WebGLSupport
m_APIs: 0b000000
m_Automatic: 0
instead of the original
<...>
- m_BuildTarget: WebGLSupport
m_APIs: 0b000000
m_Automatic: 1
<...>
However when I try to do an actual replace the complete content of the file is deleted (not the file itself)
perl -0777 -i -ne 's/(WebGLSupport\s+m_APIs:\s[a-b0-9]{8,16}\s+m_Automatic\:\s)1/${1}0/' ../../CityBotVRSimWebGL/HandTracking/ProjectSettings/ProjectSettings.asset
Can anyone tell me what is going wrong. I'm really confused since the regexp seems to be correct. Thanks!