Link to home
Start Free TrialLog in
Avatar of davysouthernboy
davysouthernboy

asked on

how do i make grep return only one match?

i have a variable that contains multiple matches.

RESULT = "Debra Jones Debra Jones Jonathon Taylor"

MATCH=`echo $RESULT |  grep -i -o -h -f ncm.txt`

MATCH contains  "Debra Jones Debra Jone" because ncm.txt is a list of names.

I need for grep to return only ONE match. How do I do this?

ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial