Reputation: 4077
I want to save iex shell history, and set ERL_AFLAGS as follows:
When start iex, it give the error information.
The os is mac os. erl version Erlang/OTP 24 [erts-12.3.2.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit] [dtrace], elixir version Elixir (1.13.4).
$ rm ~/.iex_history
$ mkdir ~/.iex_history
$ export ERL_AFLAGS="-kernel shell_history enabled -kernel shell_history_path '"$HOME/.iex_history"'"
$ iex
{"could not start kernel pid",application_controller,"{bad_environment_value,\"/Users/yuchen/.iex_history\"}"}
2022-07-27 04:24:50.471190 application_controller: ~ts: ~ts~n
["syntax error before: ","'/'"]
"/Users/yuchen/.iex_history"
could not start kernel pid (application_controller) ({bad_environment_value,"/Users/yuchen/.iex_history"})
Crash dump is being written to: erl_crash.dump...done
Upvotes: 0
Views: 361
Reputation: 3159
It seems you forgot to escape the internal "
quotes with \
: it works once you add them:
export ERL_AFLAGS="-kernel shell_history enabled -kernel shell_history_path '\"$HOME/.iex_history\"'"
Upvotes: 2