I am trying to use awk to extract lines between two patterns, but as the second pattern involves multiple $$$$
sign I do not manage to protect properly the $
input is:
Name1
iii
iii
$$$$
Name2
ii
ooo
ppp
$$$$
Name3
pp
oo
ii
uu
$$$$
desired output
Name2
ii
ooo
ppp
$$$$
I tried something like this:
awk 'BEGIN {RS="\\$\\$\\$\\$\n"; FS="\n"} $1==Name2 {print $0; print "$$$$"}' inputfile
I also tried something like
awk '/^Name2/,/\\$\\$\\$\\$\\/' input
I tried many different protection of $ but i do it wrong, either nothing is printed or it prints the entire file
Many thanks for suggestions