My input looks like this.
# Lot Of CODE Before
AppType_somethinglese=$(cat << EOF
AppType_test1='test-tool/blatest-tool-ear'
AppType_test2='test/blabla-ear'
# Lot Of CODE After
I want to print text betwen 1) _ and = and 2)/ and ' from each line
and exclude lines with "EOF".
Output looks like this
test1 blatest-tool-ear
test2 blabla-ear
How can I do this using preferably sed in bash shell?
---------- Post updated at 11:32 PM ---------- Previous update was at 11:05 PM ----------
I found answer to my problem.
awk -F "/|_|=|'" '/^AppType_/ && !/EOF$/ {print $2 " " $5}' <code file>
I would like to see how this can be done using sed or GNU grep.