diff options
-rw-r--r-- | README.markdown | 1 | ||||
-rwxr-xr-x | bin/bl | 11 | ||||
-rw-r--r-- | man/man1/bl.1df | 16 |
3 files changed, 28 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown index 6137a8b3..36d689cf 100644 --- a/README.markdown +++ b/README.markdown @@ -392,6 +392,7 @@ Installed by the `install-bin` target: * `ax(1df)` evaluates an awk expression given on the command line; this is intended as a quick way to test how Awk would interpret a given expression. * `bel(1df)` prints a terminal bell character. +* `bl(1df)` generates a given number of blank lines. * `br(1df)` launches `$BROWSER`, or a more suitable application for an URL if it knows of one. * `ca(1df)` prints a count of its given arguments. @@ -0,0 +1,11 @@ +#!/bin/sh +# Generate blank lines +if [ "$#" -ne 1 ] || [ "$1" -lt 0 ] ; then + printf >&2 'bl: Non-negative line count needed as sole argument\n' + exit 2 +fi +n=0 +while [ "$n" -lt "${1:-0}" ] ; do + printf '\n' + n=$((n+1)) +done diff --git a/man/man1/bl.1df b/man/man1/bl.1df new file mode 100644 index 00000000..2edaec38 --- /dev/null +++ b/man/man1/bl.1df @@ -0,0 +1,16 @@ +.TH BL 1df "July 2016" "Manual page for bl" +.SH NAME +.B bl +\- generate the given number of blank lines +.SH SYNOPSIS +.B bl +10 +.B bl +0 +.B bl +237481728 +.SH DESCRIPTION +.B bl +generates the given number of blank lines and prints them to stdout. +.SH AUTHOR +Tom Ryder <tom@sanctum.geek.nz> |