title: Displaying userIDs for system processes in bash
body: <p>I need to create a list of userIDs that are running process on a system regardless of if they are logged on or not. However I'm having a problem display the full user name, here's my code:</p>
  
  <pre><code>#!/bin/bash
  
  i=0
  
  top -n 1 | while read line
  do
      if [ $i -ge 7 ]
      then
          check=$(echo $line | awk '{print $3}')
          if [ $check != "root" ]
          then
              user=$(echo $line | awk '{print $2}')
              echo $user
          fi
      fi
  
      i=$((i+1))
  done
  </code></pre>
  
  <p>The top command is only printing out the first 8 characters of a user name. Is there a variation of top that will give me the full userID?</p>