dotfiles

configuration files
git clone https://pi.duncano.de/git/dotfiles.git
Log | Files | Refs | README

commit 6642f0802e6310be927e95e17c7236452c92c057
parent 0212c8cf299aaf3b4a7f74bc3861d555365feb36
Author: Duncaen <mail@duncano.de>
Date:   Mon, 13 Feb 2017 21:26:21 +0100

bin/grurls: simplify

Diffstat:
bin/grurls | 14++++----------
1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/bin/grurls b/bin/grurls @@ -1,15 +1,9 @@ #!/bin/awk -f # grurls - substitute and group urls -BEGIN { - i = 0 -} -END { - for (l = 0; l < i; l++) { - printf "[%d] %s\n", l, links[l] - } -} -{ +BEGIN { i=0 } +END { for (l = 0; l < i; l++) printf "[%d] %s\n", l, links[l] } +length() { # [title](url) while (match($0, /\[[^]]*\]\([^)]*\)/)) { lnk = substr($0, RSTART, RLENGTH) @@ -24,5 +18,5 @@ END { links[i] = substr($0, RSTART, RLENGTH) sub(/http[s]?:\/\/[^ ]*/, "[" i++ "]") } - print } +{print}