Compress heredoc declaration to one line in bash?
问题 I have this which works to declare a JSON string in a bash script: local my_var="foobar" local json=`cat <<EOF {"quicklock":"${my_var}"} EOF` The above heredoc works, but I can't seem to format it any other way, it literally has to look exactly like that lol. Is there any way to get the command to be on one line, something like this: local json=`cat <<EOF{"quicklock":"${my_var}"}EOF` that would be so much nicer, but doesn't seem to take, obviously simply because that's not how EOF works I