Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hatappo
Created July 28, 2013 23:07
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hatappo/6100650 to your computer and use it in GitHub Desktop.
Save hatappo/6100650 to your computer and use it in GitHub Desktop.
sh でヒアドキュメントを変数に代入するには、catで受けてコマンド展開する。
sql=`cat <<'EOS'
SELECT * FROM mysql.user
WHERE User = 'root'
AND Host = 'localhost'
\G
EOS`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment