Skip to content

Instantly share code, notes, and snippets.

@jmatsu
Last active August 29, 2015 14:26
Show Gist options
  • Save jmatsu/e2a046be3917cc9585c4 to your computer and use it in GitHub Desktop.
Save jmatsu/e2a046be3917cc9585c4 to your computer and use it in GitHub Desktop.
file=$0
output="output.file"
from_b=`tail -r ${file}|grep -n .|grep "#### template"|head -1|grep -o "[0-9]*"`
cat ${file}|tail -${from_b} > "${output}"
eval echo "\"$(cat ${output})\"" > "${output}"
// do something
exit 0
#### template-begin(unique strings)
foo
bar
baz
\$file #will not be evaluated
$file #will be evaluated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment