Skip to content

Instantly share code, notes, and snippets.

@tkyowa
Created February 11, 2012 06:28
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 tkyowa/1797287 to your computer and use it in GitHub Desktop.
Save tkyowa/1797287 to your computer and use it in GitHub Desktop.
シェルのヒアドキュメント記法
cat <<-'EOS' > /tmp/chihayafuru
ちはやふる
かみよもきかす
たつたかは
からくれなゐに
みつくくるとは
EOS
# * 'EOS'とシングルクォートで囲むとヒアドキュメント内の式展開無効
# * <<- の "-" は行頭のタブを無視するオプション
# * スペースはそのまま通るので注意
# * see: http://shellscript.sunone.me/input_output.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment