read does not export the variable (which is very convenient in most cases). Here, an alternative that can be exported to a single command can save or discard line breaks and allows you to mix citation styles if necessary. Works for bash and zsh.
oneLine=$(printf %s \ a \ " b " \ $'\tc\t' \ 'd ' \ ) multiLine=$(printf '%s\n' \ a \ " b " \ $'\tc\t' \ 'd ' \ )
I admit that the need for quoting makes this ugly for SQL, but it answers the question (more general) in the header.
I use it like that
export LS_COLORS=$(printf %s \ ':*rc=36:*.ini=36:*.inf=36:*.cfg=36:*~=33:*.bak=33:*$=33' \ ... ':bd=40;33;1:cd=40;33;1:or=1;31:mi=31:ex=00')
in a file obtained from my .bashrc and .zshrc .
EndlosSchleife Oct 18 '16 at 8:38 2016-10-18 08:38
source share