I was trying to run pngout
through the System.cmd and did the following in an iex shell (I’m basically running a tiny bash script that will overwrite an existing compressed image if it exists):
t = System.cmd("sh", ["-c", "yes y | pngout testimage.png tmp_testimage.png", "exit 0"], into: IO.stream(:stdio, :line))
If I do it at a bash terminal prompt it works fine, but in an iex shell it hangs. Why is that and what can be done?
(I’m also using it on a Macbook pro, Mojave, version 10.14.6 with Elixir 1.9.1-otp-22)
If I try and do something similar with another utility like pngquant, it works as expected. So although it’d be nice to get pngout working via System.cmd, I’m more curious as to why it’s not.