Search Results

Search: Posts Made By: RickCharles
5,142
Posted By elixir_sinari
awk '/EFG/{foundEFG=1;t=""} ...
awk '/EFG/{foundEFG=1;t=""}
/LMN/&&foundEFG{print;next}
/LMN/{t=t?t RS $0:$0}
END{if(!foundEFG) print t}' file
5,142
Posted By elixir_sinari
awk '/EFG/{p=1} # set variable p to 1...
awk '/EFG/{p=1} # set variable p to 1 when the pattern EFG is found
/LMN/&&p{ # when pattern LMN is found AND p is set (when EFG has been found)
print "LMN at line "NR} #...
5,142
Posted By elixir_sinari
awk '/EFG/{p=1}/LMN/&&p{print "LMN at line "NR}'...
awk '/EFG/{p=1}/LMN/&&p{print "LMN at line "NR}' file
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 12:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy