The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
grep command ~ Need help
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
grep command ~ Need help
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
6
(
permalink
)
10-23-2002
Kelam_Magnus
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".
Kelam_Magnus
View Public Profile
Find all posts by Kelam_Magnus
Find Kelam_Magnus's past nominations received
Find Kelam_Magnus's present nominations given