title: BASH FOR loop using grep and awk
body: <p>I'm trying to get this script to <code>cat</code> a file and <code>grep</code> each line for <code>877</code> and for each line found, print the first column which is an IP and store it in hosts.  It get stuck on <code>awk</code> every time.  I run <code>sh -x some.sh</code> to see where it is hung up.  Should I print to a file instead of a list?  Why does it get stuck on <code>awk</code>?</p>
  
  <pre><code>hosts=()
  
  FILENAME=/home/somethin/.hosts.conf
  
  ips=`cat $FILENAME | grep -v '877'`
  
  for line in $ips; do
       hosts=$(`awk '{print $1}'`)
  done
  
  echo $hosts
  </code></pre>