title: How do i find the first letter in alphabet from the input and count the input letters
body: <p>I have been coding bash script by using read commands to accept the input of a series of upper case alphabetic letters, one at a time. The input ends with a 0. Find and display the first letter in alphabetic order among all the valid input letters and the count of total number of valid input letters.</p>
  
  <p>if I, for example, input of D, G, T, W, Q, 3, B, 1, D, S, 0, the expected output is that: </p>
  
  <p>“3 is an invalid input”</p>
  
  <p>“1 is an invalid input”
  “The first letter in alphabet of all inputs is B”</p>
  
  <p>“You have entered 8 valid letters.”</p>
  
  <p>Here is some my code and please let me know what do I gotta fix</p>
  
  <pre><code>#!/bin/bash
  IV=()
  loop=-1
  c=Z
  ac=0
  
  while [ $loop -gt 0] || [ $loop -t 0]
  do
  echo "Enter an uppercase Alphabet"
  read b
  if [[ $b = [A-Z] ]]
  then
        ac=`expr $ac +1`
        if [ $b \&lt; $c ]
        then
                c=$b
        fi
  
  elif [ $b = "0" ]
  then
         loop=`expr $loop +1`
         for i in "${IV[@]}"
         do
         echo $i "is an invalid input"
         done
         echo "The first letter in Alphabetical order of all input is" $c
         echo "You have entered" $ac "valid letters."
  
  else
         IV[@]=$b
  fi
  done
  </code></pre>
  
  <p>So, My problem is that if i input invalid string or int, the output is like 
  "IV[@]:  bad array subscript"</p>