sed

Getting newlines

defaults domains | sed 's/, /\'$'\n/g'

Will change all ", " to a real new line. Notice the use of a single quote.

Getting $PATH line by line

echo $PATH | tr ':' '\n' will list the $PATH nicely.

So will this:
echo $PATH | sed "s/:/\\
> /g"

That is hitting return and getting the ">" that is not typed in.

Syndicate content