To avoid \n:using printf rather than echoSet StringIFS='' read -r -d '' V <<'EOF''^+%&/%+^EOFTest w/ echo ( works fine )echo $V'^+%&/%+^Test w/ printf ( fails )printf $Vbash: printf: `&': invalid format character
printf $V fails when it's: '^+%&/%+^
printf
The first argument to printf will be interpreted as a formatting string, and %& is an invalid format specifier.Try this instead:printf '%s' $VThe formatting that printf does should be explained in the printf(1) manual, or in the manual of your shell.  The %s format simply means expect a string. The printf utility does not add a newline by default.