0

I'm trying to replace each comma with a new line.

e.g. when I do the following

echo abc,wer | sed 's/\,/\n/g'

I hope to get

abc
wer

However, I got

abcnwer

What did I do wrong?

Elye
  • 53,639
  • 54
  • 212
  • 474

1 Answers1

1

Based on @MarkSetchell answer above, the below works.

echo abc,wer | tr , '\n'
Elye
  • 53,639
  • 54
  • 212
  • 474