Closed lukebakken closed 4 years ago
I think a new command, e.g. eval_file [path]
would be best.
Would it make sense for rabbitmqctl eval
to work with STDIN
?
If yes, then this could be used in a number of ways, including part of a UNIX pipeline:
[SOME CODE] | [MORE CODE] | rabbitmqctl eval
cat FILE | rabbitmqctl eval
rabbitmqctl eval < FILE
rabbitmqctl eval <<< [STRING_AS_STDIN]
By the way, how does STDIN
work on Windows?
Supporting stdin is also a good idea.
By the way, how does STDIN work on Windows
cmd.exe
supports pipes, and powershell probably has better options, but the best way on Windows will be to read a file.
This is why I think we should both add a new command to eval a file and support stdin for the command we have.
Currently you are forced to get shell quoting exactly right, which is very difficult due to the interaction between Erlang syntax and shell quoting rules. On Windows, this becomes even more difficult.
The
eval
subcommand should be able to read Erlang clauses from a file and execute them.