sed not replacing lines

后端 未结 2 1586
余生分开走
余生分开走 2021-01-12 13:16

I have a file with 1 line of text, called output. I have write access to the file. I can change it from an editor with no problems.

$ cat output         


        
2条回答
  •  借酒劲吻你
    2021-01-12 14:08

    Since this is an incredibly simple file, sed may actually be overkill. It sounds like you want the file to have exactly one character: a '0' or a '1'.

    It may make better sense in this case to just overwrite the file rather than to edit it, e.g.:

    echo "1" > output 
    

    or

    echo "0" > output
    

提交回复
热议问题