From 8a03b53126ef4ba6536718ef9487090cc10a7ca1 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Fri, 6 Dec 2019 13:00:59 -0500 Subject: allow multiple numbers on the command line --- chr.sh | 10 +++++++--- 1 file 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' -- cgit v1.2.1