Skip to content

Instantly share code, notes, and snippets.

@jdevera
Created June 4, 2013 23:58
Show Gist options
  • Save jdevera/5710630 to your computer and use it in GitHub Desktop.
Save jdevera/5710630 to your computer and use it in GitHub Desktop.
Structure for subs that output code to be eval'ed
#!/usr/bin/env bash
set -e
if [[ $1 != '__testrun__' ]]; then
sed '1,/^#BEGINEVAL/d' "$BASH_SOURCE"
exit 0
fi
#BEGINEVAL
echo hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment