Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get Erlang's release version number from a shell?
    primarykey
    data
    text
    <p>Many programs return their version number with a command like:</p> <pre><code>$ program --version program (platform info) v1.2.3 </code></pre> <p>This is useful for scripting the installation or maintenance of the program, and some other controlled automation magic from System Admins &amp; friends.</p> <h2>Problem</h2> <p><em>How to easily get the version number for Erlang (OTP)</em>?</p> <h2>On the net</h2> <p>Here are some unsatisfactory solutions ([1] and other tutorials/Erlang documentation):</p> <p><strong>Emulator</strong></p> <pre><code>$ erl 1&gt; erlang:system_info(otp_release). "R13B03" </code></pre> <p>Hard to script. I have not found a way to have <code>erl</code> execute a single command from a shell prompt.</p> <p><strong>Release file</strong></p> <pre><code>$ cat /usr/lib/erlang/releases/RELEASES [{release,"OTP APN 181 01","R13B03","5.7.4", [{kernel,"2.13.4","/usr/lib/erlang/lib/kernel-2.13.4"}, {stdlib,"1.16.4","/usr/lib/erlang/lib/stdlib-1.16.4"}, {sasl,"2.1.8","/usr/lib/erlang/lib/sasl-2.1.8"}], permanent}]. </code></pre> <p>Parsing paradise (with shell).</p> <p>An alternative could also be checking the install path, but that is not portable (my install path does not include the version, for one).</p> <p>Personal context: I am writing a script to install the same version of RabbitMQ with plugins on several machines. Some plugins have minimal requirements on the OTP version, and it is how this question started.</p> <p>[1] <a href="http://forum.trapexit.org/viewtopic.php?p=42946">http://forum.trapexit.org/viewtopic.php?p=42946</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload