Arguments passed to escript's emulator by %%! affect os:cmd/1

Sergey Samokhin prikrutil@REDACTED
Tue Jul 21 21:43:51 CEST 2009


Hello.

Some weeks ago I sent a bug report describing the problem with passing
arguments to escript's emulator by using %%! and os:cmd/1. I used R13B
to test it.

Today I've tested this with R13B01 - the problem is still here. I
reproduced it on Archlinux and FreeBSD. So I decided to write this
letter.

The easiest way reproduce the problem is by starting this script:

%-----------------------
#!/usr/bin/env escript
%%! -smp disable

main(_) ->
    os:cmd("erl -detached -sname test").
%-----------------------

Although there is no "-smp disable" within the argument to os:cmd/1,
the newly started node will have smp disabled too.

It's impossible to use "%%! <arguments>" syntax (for example to make
an escript's node hidden) because all arguments I specify are passed
to a node started by os:cmd/1.

Here is the original bug-report with all the details on how to
reproduce the bug:
http://www.erlang.org/cgi-bin/ezmlm-cgi?2:mss:1296:200905:finpkpaeoenpofkcegce

-- 
Sergey Samokhin


More information about the erlang-bugs mailing list