How do i replace [] brackets using SED

后端 未结 5 1674
予麋鹿
予麋鹿 2021-01-04 03:04

I have a string that i am want to remove punctuation from.

I started with

sed \'s/[[:punct:]]/ /g\'

But i had problems on HP-UX n

5条回答
  •  北海茫月
    2021-01-04 04:05

    Here is the final code I ended up with

    `echo "$string" | sed 's/[^a-zA-Z0-9]/ /g'`
    

    I had to put = and - at the very end.

提交回复
热议问题