Skip to content

Instantly share code, notes, and snippets.

@goddoe
Created August 21, 2019 01:13
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 goddoe/aa727bf537e481f255c4749a89a28baf to your computer and use it in GitHub Desktop.
Save goddoe/aa727bf537e481f255c4749a89a28baf to your computer and use it in GitHub Desktop.
python in makefile
Reference : xorho, https://stackoverflow.com/questions/2043453/executing-multi-line-statements-in-the-one-line-command-line
80
this style can be used in makefiles too (and in fact it is used quite often).
python - <<EOF
import sys
for r in range(3): print 'rob'
EOF
or
python - <<-EOF
import sys
for r in range(3): print 'rob'
EOF
in latter case leading tab characters are removed too (and some structured outlook can be achieved)
instead of EOF can stand any marker word not appearing in the here document at a beginning of a line (see also here documents in the bash manpage or here).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment