News for hackers. Stuff that matters.
Re:Useful sed scripts and patterns by dolmen on Friday November 12, 2021 @06:15AM (#29198142)
No mention of ';' to have multiple command on one line.

Example:

    sed '10{p;q;}' myfile.txt
Re:Useful sed scripts and patterns by adrianscheff on Friday November 12, 2021 @07:31AM (#29198663)
Thank you for your feedback! Personally I very rarely use the ; operator since it works badly with braces and commands that use files. However I've added an example using the ; operator.

PS: May I humbly point out that the command you provided will actually print up to line 10 and then a duplicate line. Like I said, unexpected (even though it seems logical). :)

Re:Useful sed scripts and patterns by dolmen on Friday November 12, 2021 @09:04AM (#29199330)
Yes: forgot -n