Erlang shell Command Chinese user manual

Source: Internet
Author: User

Reproduced from--no flowering tree: http://blog.csdn.net/mycwq/article/details/16858805

The finishing is very complete, so brought over,

The Erlang shell is a tool that uses commands and Erlang interaction in command-line mode. The Erlang shell is powerful and can be directly compiled, loaded, executed, debugged, and so on, and can be used by the shell as a terminal for Erlang projects. This article will introduce the Erlang shell commands, and simply illustrate them as examples.

Opens the Help information for Erlang Shell, which becomes Chinese here. You can also look at the official documents

Shell function Help

[Plain]View PlainCopy  
  1. Eshell V5.10.2 (abort with ^g)
  2. 1> Help ().
  3. * * Shell built-in commands * *
  4. B ()--Show all the bound variables
  5. E (N)--Repeat a query <N>
  6. F ()--Release all bound variables
  7. F (X)--releasing a variable of a binding
  8. H ()--Show previous actions
  9. History (N)--Set the number of bars before the Save Action command
  10. Results (N)--Sets the number of results of the operation before saving
  11. Catch_exception (Bool)--exception handling during the execution of the set
  12. V (N)--use the value of a query <N>
  13. RD (R,D)--Define a record
  14. RF ()--Remove all record
  15. RF (R)--Remove a record
  16. RL ()--Show all record
  17. RL (R)--Display a record information
  18. RP (term)--Displays all the contents of a tuple
  19. RR (file)--reads the record definition from a file or module
  20. * * C Module Command * *
  21. BT (PID)--shows the stack backtracking of a process
  22. C (File)--Compile and reload the module
  23. CD (Dir)--Change Working directory
  24. Flush ()--Refresh the mailbox (so the shell receives the message)
  25. Help ()--Information
  26. I ()--Display System Information
  27. Ni ()--Displays system information as well as I () and also includes system information for network nodes
  28. I (x, Y, z)--get information about a process with PID <X,Y,Z>
  29. L (module)--load or reload modules
  30. LC ([File])--Compile a list of Erlang modules
  31. LS ()--Displays the list of files in the current working directory
  32. LS (Dir)--Displays a list of files in a directory
  33. M ()--Displays the modules that have been loaded into the system
  34. M (Mod)--Display a module information
  35. Memory ()--Shows the allocation information
  36. Memory (T)--Displays an information about an allocation <T>
  37. NC (File)--Compile and load modules on all nodes
  38. NL (module)--reload module at all nodes
  39. PID (x, Y, z)-PID <X,Y,Z> acquisition of a process PID
  40. PWD ()--Show Current working directory
  41. Q ()--close Erlang shell
  42. Regs ()--Show registered process information
  43. Nregs ()--Displays registered process information as well as regs (), and also includes process information for network nodes
  44. XM (M)--find functions not defined in a module, unused functions, deprecated functions
  45. Y (file)--Compile the Yecc file (. Yrl)
  46. * * I module Command * *
  47. IH ()--Display the help information of the I module
  48. True

Shell Function Description

1. Show bound variables

B ()--Show all the bound variables

[Plain]View PlainCopy   
    1. 1> [A,b,c] = [A.]
    2. [A]
    3. 2> B ().
    4. A = 1
    5. B = 2
    6. C = 3
    7. Ok

2. Repeat Query

E (N)--Repeating a query

[Plain]View PlainCopy   
    1. 3> e (1).
    2. [A]

3. Release the binding variable

F ()--Release all bound variables
F (X)--releasing a variable of a binding

[Plain]View PlainCopy  
    1. 4> A.
    2. 1
    3. 5> f (A).
    4. Ok
    5. 6> A.
    6. * 1:variable ' A ' is unbound
    7. 7> B.
    8. 2
    9. 8> f ().
    10. Ok
    11. 9> B.
    12. * 1:variable ' B ' is unbound
    13. 10> C.
    14. * 1:variable ' C ' is unbound

4. Using Query Results

V (N)--use the value of a query

[Plain]View PlainCopy   
    1. 11> A1 = V (4).
    2. 1
    3. 12> A1.
    4. 1

5. Record operation

RD (R,D)--Define a record
RF ()--Remove all record
RF (R)--Remove a record
RL ()--Show all record
RL (R)--Display a record information

[Plain]View PlainCopy   
    1. 13> Rd (person, {name, age, address, salary, children}).
    2. Person
    3. 14> Rd (Child, {name, age}).
    4. Child
    5. 15> RL ().
    6. -record (Child,{name,age}).
    7. -record (Person,{name,age,address,salary,children}).
    8. Ok
    9. 16> RL (Child).
    10. -record (Child,{name,age}).
    11. Ok

6. Display meta-group content

RP (term)--Displays all the contents of a tuple

The Erlang shell automatically omits tuples that have too long content and can be fully displayed using the RP command

[Plain]View PlainCopy  
    1. 17> lists:seq (1,50).
    2. [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,
    3. 23,24,25,26,27,28,29| ...]
    4. 18> RP (Lists:seq (1,50)).
    5. [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,
    6. 23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,
    7. 43,44,45,46,47,48,49,50]
    8. Ok

7. Working directory

CD (Dir)--Change Working directory

PWD ()--Get working directory

[Plain]View PlainCopy   
    1. 19> pwd ().
    2. D:/tmp
    3. Ok
    4. 20> CD ("d:/").
    5. d:/
    6. Ok
    7. 21> pwd ().
    8. d:/
    9. Ok

8. Process operation

Self ()--get current process PID

PID (x, Y, z)-PID <X,Y,Z> acquisition of a process PID
Exit (Pid)--Kill a process
Catch_exception (Bool)--exception handling during the execution of the set

Erlang shell Command Chinese user manual

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.