Sha256: eed7537e2c43b661e7384b61a9c0e5668280a3b8b95ce62345a0bb9f3985a88b

Contents?: true

Size: 325 Bytes

Versions: 96

Compression:

Stored size: 325 Bytes

Contents

#!/usr/bin/env bash

if [ "$#" -ne 1 ]; then
  echo 'Usage: $0 "<phrase1>"' >&2
  exit 1
fi

phrase=`echo $1 | tr '-' ' '`
set -f -- junk $phrase
shift
for word; do
    initial="$(echo $word | head -c 1 | tr '[:lower:]' '[:upper:]')"
    acronym+=$initial
    #echo "[$word] [$initial] [$acronym]"
done
echo $acronym

exit 0

Version data entries

96 entries across 96 versions & 1 rubygems

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