Files
tsvm/assets/disk0/tvdos/bin/tee.js
2023-05-11 20:19:49 +09:00

13 lines
289 B
JavaScript

if (exec_args[1] === undefined) {
println("Usage: after a pipe,\n tee filename")
return 0
}
if (!_G.shell.hasPipe()) {
println("Pipe not opened")
return 1
}
let txt = _G.shell.getPipe()
files.open(_G.shell.resolvePathInput(exec_args[1]).full).swrite(txt)
print(txt)