[erlang-bugs] escript man page

Bengt Kleberg bengt.kleberg@REDACTED
Thu Aug 28 06:52:35 CEST 2008


If trap_exit is supposed to be false (which, I agree, is what I expect)
then either I have made a mistake somewhere(*), or there is a bug in
escript (not the man page).

(*) test program:
#! /usr/bin/env escript

main(_) -> io:fwrite( "~w~n", [erlang:process_info(erlang:self(),
trap_exit)] ).

environment:
; which escript
/app/erlang/otp_R11B05/bin/escript
; uname -a
Linux seasc0642 2.6.16.53-0.16-smp #1 SMP Tue Oct 2 16:57:49 UTC 2007
i686 i686 i386 GNU/Linux


bengt

On Wed, 2008-08-27 at 17:14 +0200, Bjorn Gustavsson wrote:
> On Wed, Aug 27, 2008 at 7:22 AM, Bengt Kleberg
> <bengt.kleberg@REDACTED> wrote:
>         Greetings,
>         
>         I would like to ask for one correction (and one clarification)
>         on the
>         escript man page (as found here:
>         http://erlang.org/doc/man/escript.html).
>         
>         1 Correction.
>         
>         The man page says:
>         
>         If you know the location of the escript executable, the first
>         line can
>         directly give the path to escript. For instance:
>         #!/usr/local/bin/escript factorial
>         
>         That is not correct and should be
>         #!/usr/local/bin/escript
>         
>         Reason: The factorial string after /usr/local/bin/escript is
>         included in
>         the call to the factorial script and means that the script
>         will always
>         say:
>         usage: factorial integer
>         
>         even when called like this:
>         ./factorial 2
>         
> Thanks! It will be corrected in R12B-4.
>  
>         
>         2 Clarification
>         
>         I can not, on the man page, find the very important
>         information (IMHO)
>         that when escript starts it has trap_exit set to true. That
>         should be
>         added, please.
> 
> That trap_exit is true is not intentional.
> 
> Maybe it would be better to change the implementation to set the
> trap_exit flag to false instead
> (to follow the principle of least surprise)?
> 
> 
> /Bjorn
> 
> -- 
> Björn Gustavsson, Erlang/OTP, Ericsson AB
> 




More information about the erlang-bugs mailing list