string_with_newlines='a
b
c'
echo $string_with_newlines |tr -s '\n' ' '
a b c
replace all newlines with a space with tr and -s squeeze option
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment