This script is supposed to look at my parameters and tell me if the word begins with an uppercase, lowercase, or digit. Right now when i put in a # of words it tells me that they are all uppercase. Thank you.
#!/bin/bash
startwithdigit=0
startwithupper=0
startwithlower=0
startwithother=0
for digit in $@
do
case $@ in
[[:lower:]]* ) startwithlower=$((startwithlower+1)) ;;
[[:upper:]]* ) startwithupper=$((startwithupper+1)) ;;
[[:digit:]]* ) startwithdigit=$((startwithdigit+1)) ;;
esac
done
echo $startwithlower words begin with a lowercase
echo $startwithupper words begin with a capital
echo $startwithdigit words begin with a digit
~ ~
digitin the body of theforloop, and$@has the same value in every iteration of the loop that is iterating over its value.((startwithlower++))etc