Replacing Control Character in sed

后端 未结 5 1991
再見小時候
再見小時候 2020-12-01 03:29

I need to replace all occurrences of the control character CTRL+A (SOH/ascii 1) in a text file in linux, how can this be achieved in SED?

5条回答
  •  失恋的感觉
    2020-12-01 03:49

    What do you want to replace them with? If the replacement is a single character, tr is a better choice than sed. To replace with the letter 'a':

    tr '\1' a < input-file > tmp && mv tmp input-file
    

提交回复
热议问题