diff options
author | Jakob Kaivo <jkk@ung.org> | 2019-12-06 13:00:59 -0500 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2019-12-06 13:00:59 -0500 |
commit | 8a03b53126ef4ba6536718ef9487090cc10a7ca1 (patch) | |
tree | d34d94603f149dc2427bb987040a711cd58390fd | |
parent | bbad39de0ef340032cac0698c399509dca929c44 (diff) |
allow multiple numbers on the command line
-rw-r--r-- | chr.sh | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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' |