aboutsummaryrefslogtreecommitdiff
path: root/emcollect
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-01-31 00:14:05 +0000
committerJohn Ankarström <john@ankarstrom.se>2021-01-31 00:14:05 +0000
commit6a0cf3b57a51d5f3c60bd1bcc53619dce9cf0355 (patch)
tree63b327f38cfff3bf6a7ee531847f27b142cfb4fd /emcollect
parent4de8bc7d3539ae3a8e64b7132b87c344eb46a5cb (diff)
downloadem-6a0cf3b57a51d5f3c60bd1bcc53619dce9cf0355.tar.gz
Remove (linktext) links, add <link> links
Diffstat (limited to 'emcollect')
-rwxr-xr-xemcollect7
1 files changed, 4 insertions, 3 deletions
diff --git a/emcollect b/emcollect
index 50f6a17..30cb7c0 100755
--- a/emcollect
+++ b/emcollect
@@ -7,12 +7,13 @@ function collect(line) {
right = $0
sub("^ \\[", "", left)
sub("\\].*$", "", left)
- sub("^ \\[[0-9a-z]+\\] ", "", right)
+ sub("^ \\[[0-9]+\\] <", "", right)
+ sub(">$", "", right)
printf "%s=%s\n", left, right
}
BEGIN { expectblock = 1 }
/^$/ { expectblock = 1; getline }
-expectblock && /^ \[[0-9a-z]+\] / { block = "nl"; expectblock = 0 }
-block = "nl" && /^ \[[0-9a-z]+\] [^ ]+$/ { collect($0); next }
+expectblock && /^ \[[0-9]+\] / { block = "nl"; expectblock = 0 }
+block = "nl" && /^ \[[0-9]+\] <[^ ]+>$/ { collect($0); next }