2. Sequential Programming
2 Sequential Programming
2.1 The Erlang Shell
Most operating systems have a command interpreter or shell, UNIX and Linux have many, Windows has the command prompt. Erlang has its own shell where bits of Erlang code can be written directly, and be evaluated to see what happens (see the shell(3)
manual page in STDLIB).
Start the Erlang shell (in Linux or UNIX) by starting a shell or command interpreter in your operating system and typing erl
. You will see something like this.
% erl Erlang R15B (erts-5.9.1) [source] [smp:8:8] [rq:8] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.9.1 (abort with ^G) 1>
Type "2 + 5." in the shell and then press Enter (carriage return). Notice that you tell the shell you are done entering code by finishing with a full stop "." and a carriage return.
1> 2 + 5. 7 2>