5 ms·
No mention of ';' to have multiple command on one line. Example: sed '10{p;q;}' myfile.txt
by dolmen 5y ago
No mention of ';' to have multiple command on one line.
Example:
sed '10{p;q;}' myfile.txt
- adrianscheff 5y agoThank 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). :)
- dolmen 5y agoYes: forgot -n