Perl substitution using string that contains a dollar sign on windows

后端 未结 2 1693
暗喜
暗喜 2021-01-22 12:38

I\'m using perl on windows and am trying to do a one liner using perl to substitute a placeholder in a file using a windows variable that contains a dollar sign. Does anyone kno

2条回答
  •  我在风中等你
    2021-01-22 13:07

    Use ' as regexp delimeter symbol. It will disable all variable substitution:

    perl -p -i.bak -e "s'!MYPASSWORD!'%NEWPASSWORD%'g" a.properties
    

提交回复
热议问题