1

I want to assign to variable to a multi-line string that contains a variable and then echo it. I attempted using here-doc as shown below. What is the best way to achieve this in csh?

set my_name="JOHN"
set my_var=<<EOF
"name":"${my_name}"
EOF

echo ${my_name}
echo ${my_var}

1 Answer 1

1

Have you tried the following ?

set my_var = '\
"name":"${my_name}" \
'

then:

echo $my_var:q

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.