Erlang Central

Print Untruncated Terms In The Shell

From ErlangCentral Wiki


While in the shell, I frequently need to view some large term (let's call it X) such as a deep list. The shell usually truncates such a term. At this point many people, muttering darkly, are forced to type in io:format("~p\n", [X]). Isn't there a better way? As it turns out, yes: use the built-in shell function rp(Term). This is used to "display a Term using the shell's record information", according to the shell's help() function, but works for any Erlang term and has the side-effect of expanding the term fully.


1> mnesia:start(), X = mnesia:system_info(all).
 %% ++++ .... rows deleted for brevity ...
 {...}|...] %% Arghhh!!!!

2> rp(X).
 %% ++++ .... rows deleted for brevity ...

An sentence from

Dmitry Podkorytov

What about io:write(Term) ?

For example: 1> io:write(lists:seq(1,50000)).