Why a linux redirect truncates the file?

后端 未结 3 1955
情话喂你
情话喂你 2021-01-22 23:31

I have a file called \"test.txt\" like that:

hello world

it is, just a \'hello world\' string. If I use a perl regex:

perl -pe          


        
3条回答
  •  自闭症患者
    2021-01-22 23:58

    perl accepts the parameter -i for inplace. With this, you can process a file with a perl program and immediately have it written back.

提交回复
热议问题