# System.stop(1) does not return code to shell

**URL:** <https://forum.elixirforum.com/t/system-stop-1-does-not-return-code-to-shell/17542>\
**Category:** Questions\
**Tags:** escript\
**Created:** [October 26, 2018, 11:12am UTC](https://forum.elixirforum.com/t/system-stop-1-does-not-return-code-to-shell/17542 "2018-10-26T11:12:28Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Phillipp](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/phillipp/32/10625_2.png) [@Phillipp](https://forum.elixirforum.com/u/Phillipp)\
**Post date:** [October 26, 2018, 11:44am UTC](https://forum.elixirforum.com/t/system-stop-1-does-not-return-code-to-shell/17542/5 "2018-10-26T11:44:20Z")

</div>

Yes, seems to fail in the erlang escript too:

```elixir
~/Private/Code/Tests/erlang_escript_test$ cat escript_test
#!/usr/local/bin/escript
%% -*- erlang -*-
%%! -smp enable -sname factorial -mnesia debug verbose
main(_) ->
    io:format("simple example\n"),
    init:stop(1).
~/Private/Code/Tests/erlang_escript_test$ ./escript_test
simple example
~/Private/Code/Tests/erlang_escript_test$ echo $?
0

```

---

_[View the full topic](https://forum.elixirforum.com/t/system-stop-1-does-not-return-code-to-shell/17542)._
