Bash: printing lines of file until SPECIAL_LINE (not included)
I came up with this:
awk '{print}/SPECIAL_LINE/{exit}' file.txt | head -n -1
Any other suggestions?
Maybe it could be more elegant.
I came up with this:
awk '{print}/SPECIAL_LINE/{exit}' file.txt | head -n -1
Any other suggestions?
Maybe it could be more elegant.
We use cookies to ensure the best experience on our website. This includes analytics, personalization, and marketing purposes. Some cookies are essential for the website to function properly.
By clicking "Accept", you consent to our use of cookies. You can read more about how we use cookies and how you can change your preferences in our Privacy Policy.