06-16-04 10:57 PM
The following returns the entire line, I just want one field...
CUT_FIELD=2
RETURN_VALUE=`grep ^${GREP_NAME} $FILE_NAME|cut -f${CUT_FIELD} -d:
`
echo $RETURN_VALUE
data looks like this:
GREP_NAME HELLO GOODBYE 1
In this case I just want to return 'GOODBYE', but in other cases I may
want to return HELLO or 1?
[ Post a follow-up to this message ]
|