Printing all lines between two strings, with one as a user input, using sed
0
votes
1
answer
81
views
I'm trying to use:
sed -n '/String1/,/String2/p' Filename
to print all lines between String1 and String2. Although I want to add String1 as a user input so,
read $userinput
sed -n '/$userinput/,/String2/p' Filename.
But as the input is within quotation is is read as the string
$userinput
instead of the given input.
Asked by Richard
(1 rep)
Jul 7, 2020, 10:09 PM
Last activity: Jul 7, 2020, 10:23 PM
Last activity: Jul 7, 2020, 10:23 PM