diff options
Diffstat (limited to 'challenge-130/abigail/bash/ch-1.sh')
| -rw-r--r-- | challenge-130/abigail/bash/ch-1.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/challenge-130/abigail/bash/ch-1.sh b/challenge-130/abigail/bash/ch-1.sh new file mode 100644 index 0000000000..64be01526e --- /dev/null +++ b/challenge-130/abigail/bash/ch-1.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# +# See ../README.md +# + +# +# Run as: bash ch-1.sh < input-file +# + +set -f + +declare -A numbers + +while read -a input +do numbers=() + for i in "${input[@]}" + do ((numbers[$i] ++)) + done + for i in "${!numbers[@]}" + do if ((numbers[$i] % 2)) + then echo $i + fi + done +done |
