aboutsummaryrefslogtreecommitdiffstats
path: root/erts/doc
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2014-01-17 14:31:23 +0100
committerHenrik Nord <[email protected]>2014-01-17 14:31:31 +0100
commit65a580abaa082019b7f21df719f0b29b1eee3577 (patch)
treef16420ae184835bcdab89a5744f097e2ed6519a5 /erts/doc
parent3199b4b663d82d83027fc74c8bf5b6c7849ad1d4 (diff)
parentd61aff41862a017b948aeac58a8340ff41e69135 (diff)
downloadotp-65a580abaa082019b7f21df719f0b29b1eee3577.tar.gz
otp-65a580abaa082019b7f21df719f0b29b1eee3577.tar.bz2
otp-65a580abaa082019b7f21df719f0b29b1eee3577.zip
Merge branch 'fenollp/escript-doc-chmod'
* fenollp/escript-doc-chmod: Add a chmod call in the CLI example OTP-11577
Diffstat (limited to 'erts/doc')
-rw-r--r--erts/doc/src/escript.xml10
1 files changed, 6 insertions, 4 deletions
diff --git a/erts/doc/src/escript.xml b/erts/doc/src/escript.xml
index 180447cac4..d2b09d4515 100644
--- a/erts/doc/src/escript.xml
+++ b/erts/doc/src/escript.xml
@@ -44,6 +44,7 @@
<p><c>escript</c> runs a script written in Erlang.</p>
<p>Here follows an example.</p>
<pre>
+$ <input>chmod u+x factorial</input>
$ <input>cat factorial</input>
#!/usr/bin/env escript
%% -*- erlang -*-
@@ -66,12 +67,13 @@ usage() ->
fac(0) -> 1;
fac(N) -> N * fac(N-1).
-$ <input>factorial 5</input>
+$ <input>./factorial 5</input>
factorial 5 = 120
-$ <input>factorial</input>
+$ <input>./factorial</input>
usage: factorial integer
-$ <input>factorial five</input>
-usage: factorial integer </pre>
+$ <input>./factorial five</input>
+usage: factorial integer
+ </pre>
<p>The header of the Erlang script in the example differs from
a normal Erlang module. The first line is intended to be the
interpreter line, which invokes <c>escript</c>. However if you