Hi,
I have this line of data: Action = ADD
And I am trying to use this command: action=`cat file.dat | grep
'Action' | awk '{print $1}' | cut -d "=" -f 2`
Most of our files do not have spaces around the equal sign, so this
works. But a few files have the spaces around the equal sign, which
is messing everything up.
Any help on how to get around this?
Many Thanks!
action=`awk -F' *= *' '/Action/ {print $2}'`
As you can see, awk contains the capabilities of both grep and cut.
--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Thanks!