2016-08-11 4 views

답변

2
cat <<'EOF' 
hello $$ 
I'm a here document that doesn't interpolate 
any $-variables because of the qutoes around 
the EOF marker 
EOF 

echo ------- 

cat <<EOF 
hello $$ 
I'm a here document that does interpolate 
EOF 

echo ------- 

cat <<x 
It doesn't matter what you use as the end of file marker 
x 

echo ------- 

cat <<'x' 
Quotes prevent $-interpolation 
x 

출력 :

hello $$ 
I'm a here document that doesn't interpolate 
any $-variables because of the qutoes around 
the EOF marker 
------- 
hello 29843 
I'm a here document that does interpolate 
------- 
It doesn't matter what you use as the end of file marker 
------- 
Quotes prevent $-interpolation 
관련 문제