Hi,
I need to extract all the content between two strings stored in two variables "startstring" and "endstring"
startstring=hello
enstring=world
#notworking
awk '/$startstring/, $NF ~ /$endstring/ ' file > file2
The above code is not working with variables. It works when actual string values are used as patterns as below.
#workingcode
awk '/hello/, $NF ~ /world/ ' file > file2
Can someone help me to use these two variables in awk for searching the patterns.
Thanks.
Thanks & Regards,
Jean