Archive

Posts Tagged ‘shell’

Erlang Shell实用小技巧

October 5th, 2011 3 comments

原创文章,转载请注明: 转载自系统技术非业余研究

本文链接地址: Erlang Shell实用小技巧

Erlang Shell下有很多内置的命令,在平时交互的时候很好用,文档里面都是一行带过,大家可能没什么感觉。
我来重点讲解和演示下:

$ erl
Erlang R14B04 (erts-5.8.5) [/source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.8.5  (abort with ^G)
1> help().
** shell internal commands **
b()        -- display all variable bindings
e(N)       -- repeat the expression in query <N>
f()        -- forget all variable bindings
f(X)       -- forget the binding of variable X
h()        -- history
history(N) -- set how many previous commands to keep
results(N) -- set how many previous command results to keep
catch_exception(B) -- how exceptions are handled
v(N)       -- use the value of query <N>
rd(R,D)    -- define a record
rf()       -- remove all record information
rf(R)      -- remove record information about R
rl()       -- display all record information
rl(R)      -- display record information about R
rp(Term)   -- display Term using the shell's record information
rr(File)   -- read record information from File (wildcards allowed)
rr(F,R)    -- read selected record information from file(s)
rr(F,R,O)  -- read selected record information with options

我最经常用的有以下几个,熟悉了感觉就很爽:
Read more…

Post Footer automatically generated by wp-posturl plugin for wordpress.

Categories: Erlang探索 Tags: