(def [stdin-r stdin-w] (os/pipe))
(def [stdout-r stdout-w] (os/pipe))
# write the input that will be sent to sed
(:write stdin-w "hello world 1\nhello world 2")
(:close stdin-w)
(os/execute
@("sed" "s|world|janet|g")
:px
# the program reads from :in and writes to :out
{:in stdin-r :out stdout-w})
(:read stdout-r math/int32-max)
# => @"hello janet 1\nhello janet 2"
# feed two lines to sed, which replaces "world"
# with "janet", and read the modified results back