Last active
September 27, 2016 18:26
-
-
Save oldratlee/c0464773de8ddae759862eac3d417293 to your computer and use it in GitHub Desktop.
shell convenient alias/function for #erlang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run erlang MFA(Module-Function-Args) conveniently, like | |
# erun fac1 main 25 # example from book programming erlang. | |
erun() { | |
if [ $# -lt 2 ]; then | |
echo "Error: at least 2 args!" | |
return 1 | |
fi | |
erl -s "$@" -s init stop -noshell | |
} | |
# Run erlang one-line script conveniently, like | |
# erline 'io:format("Hello world~n").' | |
erline() { | |
if [ $# -ne 1 ]; then | |
echo "Error: Only need 1 arg!" | |
return 1 | |
fi | |
erl -eval "$1" -s init stop -noshell | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment