title: not able to exit from loop
body: <p>i have a created a code to parse hostname,username and privilege from files in a dir..how ever i am not able to exit at the end of the code .the loop gives perfact data output.but not giving shell prompt back.
  array arg[] contain name of file value</p>
  
  <pre><code>c=0
  
  while((c&lt;=${#arg[*]}))
  
   do
  
  hname=`grep -e "^hostname" ${arg[$c]} |awk '{ print $2 }'| sort |uniq`
  
  if [[ -n $hname ]]
  
  then
       logDebug "data found for the $hname"
  
  while read -r line; do
  
  for term in "echo $line"; do
  
      if [[ "$term" =~ (username)[[:space:]](.*?) ]]; then
  
           userid=`echo "${BASH_REMATCH[2]}" | awk '{print $1}'`
  
              logDebug "username: $userid"
  
  
              if [[ "$term" =~ (privilege)[[:space:]](.*?) ]]; then
  
               Priv=`echo "${BASH_REMATCH[2]}" | awk '{print $1}'`
  
               PRIV=`echo "level=$Priv"`
  
               logDebug "Privilege: $PRIV"
  
                  echo"$CUSTOMER|S|$hname|$OS|$userid|$Uid_Conv|$Uic_mode|$State|$i_login|$group|$PRIV|" &gt;&gt; "$OutputFile"
  
              fi
  
      fi
     done
  done &lt; "${arg[$c]}"
  
  fi
  
  
  let c=c+1
  done
  </code></pre>