Files
hawk/t/two-way-pipe.hawk
hyung-hwan 2bc122f23a
All checks were successful
continuous-integration/drone/push Build is passing
added @pragma rwpipe
changed || to |& for bidirectional piping
2025-10-04 01:39:25 +09:00

11 lines
231 B
Plaintext

BEGIN {
cmd = "sort";
data = hawk::array("hello", "world", "two-way pipe", "testing");
for (i = 1; i <= length(data); i++) print data[i] |& cmd;
close(cmd, "to");
while ((cmd |& getline line) > 0) print line;
close(cmd);
}