summaryrefslogtreecommitdiffstats
path: root/ncat/test/toupper.lua
diff options
context:
space:
mode:
Diffstat (limited to 'ncat/test/toupper.lua')
-rw-r--r--ncat/test/toupper.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/ncat/test/toupper.lua b/ncat/test/toupper.lua
new file mode 100644
index 0000000..7b9d79a
--- /dev/null
+++ b/ncat/test/toupper.lua
@@ -0,0 +1,14 @@
+--Emulates the RFC 862 echo service, behaving like Unix's "cat" tool.
+
+while true do
+
+ data = io.stdin:read(1)
+
+ if data == nil then
+ break
+ end
+
+ io.write(data:upper())
+ io.flush()
+
+end