Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This doesn't work, the comment doesn't contain the IP_ADDR string


cat <<"EOF" >> .ssh/config
# VirtualBox (VB) on user's laptop at $IP_ADDR
Host laptopvb
  Hostname $IP_ADDR
  User $SSH_UN
  ForwardAgent yes
share|improve this question
up vote 3 down vote accepted

Remove the double quotes around the EOF:

cat <<EOF >> .ssh/config
# VirtualBox (VB) on hobs laptop at $IP_ADDR
Host laptopvb # manually set as a static IP on the VB
  Hostname $IP_ADDR
  User $SSH_UN
  ForwardAgent yes

According to the bash manual:

The format of here-documents is:


No parameter expansion, command substitution, arithmetic expansion, 
or pathname expansion is performed on word. If any characters in word are quoted, 
the delimiter is the result of quote removal on word, and the lines in the
here-document are not expanded. If word is unquoted, all lines of the
here-document are subjected to parameter expansion, command substitution,
and arithmetic expansion.  
share|improve this answer
I could've sworn I tried that. Obviously not, 'cause it works. Thx. – hobs Sep 7 '12 at 17:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.