I want to search the pattern in a certain range but in reverse order. For example if I give the range say 200,250 then I want that search should be performed in reverse order means search should start from line number 250 and if any line matche the pattern then print the line number
I have tried this command sed -n '!G;h;200,250{\|perl: warning:|=}' a.txt but it actually perform the search in ascending order
I have searched on internet and found if we do sed '1!G;h;$!d' a.txt then it actually print the file in reverse order. Just want to modify this command such that it print the line number in reverse order on each pattern match.
So How can I modify the command. Please help
tacthe output? – choroba May 26 '20 at 15:21