Commit c3203042 authored by Caleb Cooper's avatar Caleb Cooper
Browse files

Added support for spaces if the input string is quoted.

parent 435f145f
......@@ -8,8 +8,11 @@ declare -A CHARS_COUNT
for (( CHAR_NUM=0 ; CHAR_NUM < ${#INPUT} ; CHAR_NUM++ )); do
unset CUR_CHAR
CUR_CHAR="${INPUT:$CHAR_NUM:1}"
if [[ "${CUR_CHAR}" =~ [[:space:]] ]]; then
CUR_CHAR='ѕрасе'
fi
CHARS[${CHAR_NUM}]=${CUR_CHAR}
if [[ "${!CHARS_COUNT[*]}" =~ ${CUR_CHAR} ]]; then
if [[ "${!CHARS_COUNT[*]}" =~ "${CUR_CHAR}" ]]; then
CHARS_COUNT[${CUR_CHAR}]=$((${CHARS_COUNT[${CUR_CHAR}]} + 1))
else
CHARS_COUNT[${CUR_CHAR}]=1
......@@ -22,4 +25,4 @@ for CHAR in ${CHARS[*]}; do
PRINTED_CHARS+="${CHAR}"
echo ${CHAR} ${CHARS_COUNT[${CHAR}]}
fi
done
\ No newline at end of file
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment