Search Results

Search: Posts Made By: urello
19,870
Posted By urello
Sed. Delete line before and after pattern.
Hi.
In need to delete line before and after pattern in file. I came to following commands.
Delete line before
sed -ni '/pattern/{x;d;};1h;1!{x;p;};${x;p;}' /etc/testfile
Delete line after
sed -i...
Showing results 1 to 1 of 1

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