On Linux I use this to get the next two lines after the [test]
line:
sed -n '/\[test\]/{n;p;n;p}' my-file
On Mac I get:
sed: 1: "/\\[test\\]/{n;p;n;p}": extra characters at the end of p command.
Is there an expression that works on both platforms or on Mac a completely different command must be used?
Add an extra semi-colon after the last p
sed -n '/\[test\]/{n;p;n;p;}' my-file
(not related to Mac version, also fails on MSYS)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments