#!/bin/sh -e

# check to see if a pipe exists on stdin.
if [ -p /dev/stdin ]; then
  # if we want to read the input line by line
  while IFS= read -r line; do
    echo "${line}" | tr '[:lower:]' '[:upper:]'
  done
elif [ "$#" -gt 0 ]; then
  echo "$@" | tr '[:lower:]' '[:upper:]'
fi
