Use env variables with System.cmd or Ports?

@isaacsanders & @peerreynders

iex(16)> port = Port.open({:spawn, "/bin/echo $GOPATH"}, [:binary])
#Port<0.19>
iex(17)> flush
{#Port<0.19>, {:data, "/Users/rlthompson/go\n"}}

:spawn vs :spawn_executable. Now I feel dumb.

1 Like