erlang shell commands

本文详细介绍了Shell环境下的命令功能,包括变量操作、历史记录管理、异常处理等。还讲解了如何定义和读取记录,以及一些实用的操作技巧。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Shell Commands

b()
Prints the current variable bindings.
f()
Removes all variable bindings.
f(X)
Removes the binding of variable X.
h()
Prints the history list.
history(N)
Sets the number of previous commands to keep in the history list to N. The previous number is returned. The default number is 20.
results(N)
Sets the number of results from previous commands to keep in the history list to N. The previous number is returned. The default number is 20.
[color=red]e(N)
Repeats the command N, if N is positive. If it is negative, the Nth previous command is repeated (i.e., e(-1) repeats the previous command).
v(N)
Uses the return value of the command N in the current command, if N is positive. If it is negative, the return value of the Nth previous command is used (i.e., v(-1) uses the value of the previous command).[/color]
help()
Evaluates shell_default:help().
c(File)
Evaluates shell_default:c(File). This compiles and loads code in File and purges old versions of code, if necessary. Assumes that the file and module names are the same.
catch_exception(Bool)
Sets the exception handling of the evaluator process. The previous exception handling is returned. The default (false) is to kill the evaluator process when an exception occurs, which causes the shell to create a new evaluator process. When the exception handling is set to true the evaluator process lives on which means that for instance ports and ETS tables as well as processes linked to the evaluator process survive the exception.
rd(RecordName, RecordDefinition)
Defines a record in the shell. RecordName is an atom and RecordDefinition lists the field names and the default values. Usually record definitions are made known to the shell by use of the rr commands described below, but sometimes it is handy to define records on the fly.
rf()
Removes all record definitions, then reads record definitions from the modules shell_default and user_default (if loaded). Returns the names of the records defined.
rf(RecordNames)
Removes selected record definitions. RecordNames is a record name or a list of record names. Use '_' to remove all record definitions.
rl()
Prints all record definitions.
rl(RecordNames)
Prints selected record definitions. RecordNames is a record name or a list of record names.
rp(Term)
Prints a term using the record definitions known to the shell. All of Term is printed; the depth is not limited as is the case when a return value is printed.
rr(Module)
Reads record definitions from a module's BEAM file. If there are no record definitions in the BEAM file, the source file is located and read instead. Returns the names of the record definitions read. Module is an atom.
rr(Wildcard)
Reads record definitions from files. Existing definitions of any of the record names read are replaced. Wildcard is a wildcard string as defined in filelib(3) but not an atom.
rr(WildcardOrModule, RecordNames)
Reads record definitions from files but discards record names not mentioned in RecordNames (a record name or a list of record names).
rr(WildcardOrModule, RecordNames, Options)
Reads record definitions from files. The compiler options {i, Dir}, {d, Macro}, and {d, Macro, Value} are recognized and used for setting up the include path and macro definitions. Use '_' as value of RecordNames to read all record definitions.

实用!
https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/23/el/8/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found 正在尝试其它镜像。 To address this issue please refer to the below wiki article https://wiki.centos.org/yum-errors If above article doesn't help to resolve this issue please use https://bugs.centos.org/. One of the configured repositories failed (rabbitmq-erlang), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled yum --disablerepo=rabbitmq-erlang ... 4. Disable the repository permanently, so yum won't use it by default. Yum will then just ignore the repository until you permanently enable it again or use --enablerepo for temporary usage: yum-config-manager --disable rabbitmq-erlang or subscription-manager repos --disable=rabbitmq-erlang 5. Configure the failing repository to be skipped, if it is unavailable. Note that yum will try to contact the repo. when it runs most commands, so will have to try and fail each time (and thus. yum will be be much slower). If it is a very temporary problem though, this is often a nice compromise: yum-config-manager --save --setopt=rabbitmq-erlang.skip_if_unavailable=true failure: repodata/repomd.xml from rabbitmq-erlang: [Errno 256] No more mirrors to try. https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/23/el/8/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
最新发布
07-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值