summaryrefslogtreecommitdiff
path: root/src/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/test.sh')
-rwxr-xr-xsrc/test.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test.sh b/src/test.sh
new file mode 100755
index 0000000..84c5405
--- /dev/null
+++ b/src/test.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+
+line="hell o world"
+# replace tabs with spaces
+l="$line"
+line=
+while [ "$l" ]; do
+ c="${l%*${l#?}}"
+ case "$c" in
+ "\t") line="$line ";;
+ *) line="$line$c" ;;
+ esac
+ l="${l#?}"
+ printf "%s\n" "$c"
+done
+printf "%s\n" "$line"
+