Skip to content

Instantly share code, notes, and snippets.

@skaji
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skaji/9489797 to your computer and use it in GitHub Desktop.
Save skaji/9489797 to your computer and use it in GitHub Desktop.
#!/bin/sh
cat <<EOF > out
this is here doc.
EOF
# シングル or ダブルクオートで囲むと変数展開しない。
cat <<"EOF" > out
path is $PATH
EOF
sudo sh -c 'cat <<EOF > sudo-out
this is sudo here doc
EOF
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment