The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 04-28-2008
sam4now sam4now is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 23
printing each users by processes

hello All,

i am trying to get the each users by with thier processing. I have try it in several ways but i am not getting thier my code is

#!bin/bash/
users=`cat /etc/passwd | cut -d':' -f5`
onlineusers=`users | tr '.' ' '`
$onlineusers | while read `$users`
do
echo `ps -U $users`
done

but its not working, root: it says command not found

pls any way around it.