I’d like to run an OS command that outputs to stdin, passing in the program to run and its arguments, along with some environment variables that I want to set first.
But since my_command can produce hundreds of megabytes of output, I don’t want to capture and return it back to elixir. Instead, I want to redirect its output to a file that I can post-process.
What is the recommended way to redirect the output of the run command to a file?
Output redirection is a shell feature, so you’re going to have to pass the command to a shell for execution. Assuming you’re on a Unix-style OS with Bash you could do something like: