From 7bda88d9698770de84f92cf057fbeeb7e5a4eae7 Mon Sep 17 00:00:00 2001 From: Diego Zamboni Date: Thu, 12 Oct 2017 14:51:55 +0200 Subject: [PATCH] Test implementation of pipesplit, see https://github.com/elves/elvish/issues/500 for context and discussion --- .elvish/rc.elv | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.elvish/rc.elv b/.elvish/rc.elv index 5729cac..5a8e901 100644 --- a/.elvish/rc.elv +++ b/.elvish/rc.elv @@ -132,6 +132,21 @@ fn cdb [p]{ cd (dirname $p) } E:LESS = "-i -R" E:GOPATH = ~/Personal/devel/go/ E:EDITOR = "vim" + paths = [ $@paths $E:GOPATH/bin ] -fortune | lolcat +fn pipesplit [l1 l2 l3]{ + pout = (pipe) + perr = (pipe) + run-parallel { + $l1 > $pout 2> $perr + pwclose $pout + pwclose $perr + } { + $l2 < $pout + prclose $pout + } { + $l3 < $perr + prclose $perr + } +}