summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-12-06 13:00:59 -0500
committerJakob Kaivo <jkk@ung.org>2019-12-06 13:00:59 -0500
commit8a03b53126ef4ba6536718ef9487090cc10a7ca1 (patch)
treed34d94603f149dc2427bb987040a711cd58390fd
parentbbad39de0ef340032cac0698c399509dca929c44 (diff)
allow multiple numbers on the command line
-rw-r--r--chr.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/chr.sh b/chr.sh
index ecc1a54..3759eff 100644
--- a/chr.sh
+++ b/chr.sh
@@ -1,6 +1,10 @@
-if [ $# -ne 1 ]; then
- printf 'usage: %s number\n' "$0"
+if [ $# -eq 0 ]; then
+ printf 'usage: %s number...\n' "$0"
exit 1
fi
-printf '%b\n' "\\0$(printf '%o' "$1")"
+while [ $# -gt 0 ]; do
+ printf '%b' "\\0$(printf '%o' "$1")"
+ shift
+done
+printf '\n'