The UNIX and Linux Forums  


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 -->
  #2 (permalink)  
Old 11-21-2007
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
It isn't working because with cut, you are cutting the first 10 columns. This causes spaces to be padded to the actual usernames in the /tmp/users1$$ file.

Use this instead:

last| cut -d" " -f1 |sort -u > /tmp/users1$$