On a macOS you’ll need to install gnu-sed (e.g., brew install gnu-sed), which is invoked using “gsed.” Otherwise, try the below script on your *nix system.
#!/bin/bash
while read line
do
echo -e “$line” | sed -r ‘s/\<./\U&/g’
done < “${1:-/dev/stdin}”
Topics of interest: parameter substitution, pipes in bash, and uppercasing in sed.