Sha256: 515ed3ac1be7094ea9cb3f2ae08237d1e7ebcda75351f2547ed34cd9d24c3354

Contents?: true

Size: 495 Bytes

Versions: 92

Compression:

Stored size: 495 Bytes

Contents

#!/usr/bin/env bash

input="$1"

if [[ ! -n "${input}" ]]
then
	echo "Usage: $0 <input>"
	exit
fi

echo "$input" \
  | tr '[:upper:]' '[:lower:]' \
  | tr '.,:&@$%^!' ' ' \
  | awk -f <(cat - <<-'HEREDOC'
      {
        for (field_index = 1; field_index <= NF; field_index++)
        {
          result[$field_index]++
        }
      }
      END {
        for (field_index in result)
        {
          printf "%s: %d\n", field_index, result[field_index]
        }
      }
HEREDOC
)

exit $?

Version data entries

92 entries across 92 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.179 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.178 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.177 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.176 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.175 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.174 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.173 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.172 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.171 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.170 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.169 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.167 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.166 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.165 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.164 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.163 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.162 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.161 tracks/bash/exercises/word-count/example.sh
trackler-2.2.1.160 tracks/bash/exercises/word-count/example.sh