Reputation: 1728
I'm very new to Erlang. I've tried now several hours to find out how to run my sample scripts without the Erlang Shell.
I have installed Erlang with Mac Ports, and I can access the Shell, write Scripts etc.
But I try to run my program in the Mac Terminal.
On this page [1] they are using ecc and elink. I don't have these programs in my installation.
Can you please provide me a way, how I can solve my problem?
Thanks and regards
chris
[1] http://www.sics.se/~joe/sae.html
Upvotes: 1
Views: 1379
Reputation: 1830
Try rebar (https://bitbucket.org/basho/rebar/wiki/Home) :)
Upvotes: 0
Reputation: 32953
You need to add:
#!/usr/bin/env escript
at the beginning of your script and make it executable (as @nomulous said):
chmod u+x myscript
Then you can run it like this:
./myscript
if it is in your current directory, or by giving its relative or full path otherwise, e.g.:
~/Desktop/myscript
Reference: the page you gave section Erlang Scripts
Upvotes: 5
Reputation: 2038
If your script is not executable, it won't run outside of the shell.
To make it executable, use chmod +x your_script_here
.
Upvotes: 1