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 -->
  #6 (permalink)  
Old 10-23-2002
Kelam_Magnus's Avatar
Kelam_Magnus Kelam_Magnus is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
I use HPUX as well. This works.

When you are saying it doesn't work, do you mean that you can't get ONLY the first word? but instead get the whole line?

Then use this.

grep "^testabc" /etc/group |awk -F: '{ print $1 }'

This will give you ONLY the word "testabc".