Hi
I have a file.txt like this
aword1 aword2 aword3 XXX = aword5 YYYY aword1 aword3 aword3 aword5
aword7 aword2 aword8 aword9 aword10 aword11 aword12 aword13 aword16
aword17
I have to extract 'aword5' using simplest combination of sed/awk. I
believe it can be done with sed only but wasn't able to find exact
"magic" expression.
One expression works though:
sed -n "s/XXX.=./#/p" ./file.txt |awk -F"#" '{ print $2 }' |awk ' {
print $1 }'
I am looking for simpler/faster version... and I don't like the
possibility that # may be already present. Help appreciated!
Thanks
Andrew