diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-01-13 20:18:22 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-01-13 20:18:22 +1300 |
commit | e79e53c707145f7a7bdd4ae1049b4bc6dcbf28b7 (patch) | |
tree | 14daff1819711bd53ddf03a935717d7a3e9c2219 /bin | |
parent | Merge branch 'feature/ax-safety' into develop (diff) | |
download | dotfiles-e79e53c707145f7a7bdd4ae1049b4bc6dcbf28b7.tar.gz dotfiles-e79e53c707145f7a7bdd4ae1049b4bc6dcbf28b7.zip |
Reimplement bl(1df) in Awk
This is shorter and tidier.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/bl.awk | 5 | ||||
-rw-r--r-- | bin/bl.sh | 10 |
2 files changed, 5 insertions, 10 deletions
diff --git a/bin/bl.awk b/bin/bl.awk new file mode 100644 index 00000000..0be2fc6e --- /dev/null +++ b/bin/bl.awk @@ -0,0 +1,5 @@ +# Generate blank lines +BEGIN { + while (ARGV[1]--) + print "" +} diff --git a/bin/bl.sh b/bin/bl.sh deleted file mode 100644 index 6dd3d687..00000000 --- a/bin/bl.sh +++ /dev/null @@ -1,10 +0,0 @@ -# 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 |