aboutsummaryrefslogtreecommitdiffstats
path: root/test/up_down.awk
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 12:09:58 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 12:09:58 +0300
commitcae8bc6ced84c12590e3554a06a952283735363a (patch)
treeca4f38bfcb1312bfb62fc693564d68f3e9b3e973 /test/up_down.awk
parentdbd583bd2b8a6dd40c622875a4e197360cb5aba7 (diff)
downloadegawk-cae8bc6ced84c12590e3554a06a952283735363a.tar.gz
egawk-cae8bc6ced84c12590e3554a06a952283735363a.tar.bz2
egawk-cae8bc6ced84c12590e3554a06a952283735363a.zip
Move to 2.14.
Diffstat (limited to 'test/up_down.awk')
-rw-r--r--test/up_down.awk15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/up_down.awk b/test/up_down.awk
new file mode 100644
index 00000000..32ab847c
--- /dev/null
+++ b/test/up_down.awk
@@ -0,0 +1,15 @@
+{
+ lim = split ($0, line)
+ out = ""
+ if (lim > 0) {
+ i = 0
+ while (i < lim) {
+ i++
+ if (i % 2)
+ out = out sprintf("%s ", toupper(line[i]))
+ else
+ out = out sprintf("%s ", tolower(line[i]))
+ }
+ }
+ print out
+}