#!../luxio-5.1

package.path = package.path .. ":../?.lua"
package.cpath = package.cpath .. ":../?.so"

sio = require "luxio.simple"
sp = require "luxio.subprocess"

mytr = sp.spawn_simple {
       "tr", "[a-z]", "[A-Z]",
       stdin = sp.PIPE,
       stdout = sp.PIPE,
}

mytr.stdin:write "Hello, world!\n"
mytr.stdin:close()

print(mytr.stdout:read "*a")

print(mytr:wait())
