I have a bash script that involves the output of yad. By default, yad outputs its results separated by pipe characters "|".
I have a string variable output.
Echoing it shows it contains this:
/dev/sde|
name0|name1|name2|
I want all those vertical bars changed to line breaks.
This does not work: echo "$output" | tr '|' '\n'
And neither does this: echo "$output" > /tmp/output; echo $(cut -d'|' -f1 < /tmp/output)
Both attempts result in only a line break being outputted. /tmp/output was created, and it contained two empty lines but not any text.