That < syntax in shell is just a way to pipe the contents of a file onto the STDIN of the command. Interestingly, wc will also take a filename as a regular argument. So for either of those to work you would need to write your string to a file and use that (although I’m not sure the < would work anyway, because I believe it’s a shell feature).
But, it’s fairly simple to write to the STDIN of a command from Elixir without using any special shell syntax, just that you need to use the underlying Port module directly (which is what System.cmd is using under the hood).
All that having been said, if you’re really just trying to count the number of lines in the string:
my_stream |> String.split("\n") |> Enum.count()






















