title: shell script syntax error: redirection unexpected during done command
body: <p>So, I'm trying to make a shell script for a class and it basically just performs a few administrative operations. Right now, I'm getting a syntax error on the done command on lines 27 and 45. I feel it might be my use of awk.</p>
  
  <pre><code>#!/bin/sh
  ps -cefl &gt; userInfo
  while [ "$menuOption" != 4 ]; do
      echo "===================================="
      echo "Select a menu option!"
      echo "(1) Ancestry History"
      echo "(2) Who's online"
      echo "(3) What process a user is running"
      echo "(4) Exit"
      echo -n "Menu option:"
      read menuOption
      echo " "
      if [ "$menuOption" -eq 1 ]; then
          echo "The ancestry tree for the current process is. . ."
          echo " "
          PID=$$
          while [ $PID -ne 1 ]
          do
              echo $PID
              echo " | "
              while read PIDS; do
                  myPID=$(echo $PIDS | awk '{print $1}')
                  myPPID=$(echo $PIDS | awk '{print $2}')
                  if [ $myPID -eq $PID ]; then
                      PID=$myPPID
                  fi
              done &lt; &lt;(grep $PID userInfo | awk '{printf "%i %i\n",$4,$5}')
          done
          echo " 1 "
          echo " "
      elif [ "$menuOption" -eq 2 ]; then
          echo "Online users:"
          echo "-------------"
          who | awk '{print $1}' | sort -u
          echo "-------"
          echo " "
      elif [ "$menuOption" -eq 3 ]; then
          i=0
          echo "Select a user to see the processes!"
          echo "-----------------------------------"
          while read value; do
              listNames["$i"]="$value"
              echo "$i)${listNames[$i]}"
              i=$(($i+1))
          done &lt; &lt;(who | awk '{print $1}' | sort -u)
          echo -n "Select user: "
          read userOption
          echo " "
          echo "You've selected: ${listNames[$userOption]}"
          grep ${listNames[$userOption]} userInfo | awk '{printf "%-7s %-7s %-7s %-7s %-7s %-7s %-10s %s %s\n",$3,$4,$5,$9,$11,$12,$13,$14,$15}' | sort;
          echo " "
      elif [ "$menuOption" -eq 4 ]; then
          echo "Exiting Script!"
      fi
  done
  </code></pre>