Sha256: 5def434906c1db1cc0c3423c2a18df0dbaf4b131eb78656f505ecae69fdc2e51

Contents?: true

Size: 317 Bytes

Versions: 9

Compression:

Stored size: 317 Bytes

Contents

#!/bin/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

9 entries across 6 versions & 1 rubygems

Version Path
trackler-2.2.1.82 tracks/bash/exercises/acronym/example.sh
trackler-2.2.1.81 tracks/bash/exercises/acronym/example.sh
trackler-2.2.1.80 tracks/bash/exercises/acronym/example.sh
trackler-2.2.1.79 tracks/bash/exercises/acronym/acronym.sh
trackler-2.2.1.79 tracks/bash/exercises/acronym/example.sh
trackler-2.2.1.78 tracks/bash/exercises/acronym/example.sh
trackler-2.2.1.78 tracks/bash/exercises/acronym/acronym.sh
trackler-2.2.1.77 tracks/bash/exercises/acronym/example.sh
trackler-2.2.1.77 tracks/bash/exercises/acronym/acronym.sh