Yes, but the problem is that readandwrite() does not provide access to
stderr (see https://github.com/JuliaLang/julia/issues/11824). That's why
I've been trying alternative solutions.

On Mon, Dec 7, 2015 at 1:17 PM, James Gilbert <jgrgilb...@gmail.com> wrote:

> Turns out that there is a function *readandwrite()
> <http://docs.julialang.org/en/release-0.4/stdlib/base/#Base.readandwrite>* 
> which
> does exactly what we need:
>
> function main()
>     letters = ["v", "w", "x", "y", "z"]
>     str = join(["$a$b\n" for a in letters, b in letters])
>     print("\nBefore grep:\n", str)
>
>     (grepout, grepin, grep) = readandwrite(`grep y`)
>     print(grepin, str)
>     close(grepin)
>     filtered_str = readall(grepout)
>     print("\nAfter grep:\n", filtered_str)
> end
>
>
> main()
>
>
>

Reply via email to