Author: fernape (ports committer) Date: Thu Jun 18 08:26:26 2020 New Revision: 362298 URL: https://svnweb.freebsd.org/changeset/base/362298
Log: nl(1): Add EXAMPLES section Add EXAMPLES section covering flags -b[ap] -n -i -s -v Approved by: bcr@ Differential Revision: Add EXAMPLES section covering flags -b[ap] -n -i -s -v Modified: head/usr.bin/nl/nl.1 Modified: head/usr.bin/nl/nl.1 ============================================================================== --- head/usr.bin/nl/nl.1 Thu Jun 18 07:35:18 2020 (r362297) +++ head/usr.bin/nl/nl.1 Thu Jun 18 08:26:26 2020 (r362298) @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 4, 2014 +.Dd June 18, 2020 .Dt NL 1 .Os .Sh NAME @@ -230,6 +230,42 @@ as described in .Xr environ 7 . .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Number all non-blank lines: +.Bd -literal -offset indent +$ echo -e "This is\\n\\n\\na simple text" | nl + 1 This is + + + 2 a simple text +.Ed +.Pp +Number all lines including blank ones, with right justified line numbers with +leading zeroes, starting at 2, with increment of 2 and a custom multi-character +separator: +.Bd -literal -offset indent +$ echo -e "This\\nis\\nan\\n\\n\\nexample" | nl -ba -n rz -i2 -s "->" -v2 +000002->This +000004->is +000006->an +000008-> +000010-> +000012->example +.Ed +.Pp +Number lines matching regular expression for an +.Em i +.No followed by either +.Em m +.No or +.Em n +.Bd -literal -offset indent +$ echo -e "This is\\na simple text\\nwith multiple\\nlines" | nl -bp'i[mn]' + This is + 1 a simple text + with multiple + 2 lines +.Ed .Sh SEE ALSO .Xr jot 1 , .Xr pr 1 _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"