Why does this shell script work for one instance and not the other? [duplicate]
问题 This question already has answers here : How to cat <<EOF >> a file containing code? (4 answers) Closed 2 years ago . I'm in need of some explanation of the following code, because they are the same concepts but not working the same. So, I'm trying to do the following: #!/bin/sh ssh -T username@host << EOF relative="$HOME/Documents" command=$(find \$relative -name GitHub) command2=$(echo \$relative) echo "HERE: \$command" echo "HERE: \$command2" EOF Here is the output I get: find: ‘$relative’