commit ab5dcdb352d301572ec646e60266d8e919fd8c07 parent 977a50ea70a234538146be877f403595729892c8 Author: Antoine Amarilli <a3nm@a3nm.net> Date: Sun, 8 Jan 2017 01:52:55 +0100 bibgeturl Diffstat:
bibgeturl | | | 14 | ++++++++++++++ |
bibgeturls | | | 9 | +++++++++ |
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/bibgeturl b/bibgeturl @@ -0,0 +1,14 @@ +#!/usr/bin/zsh + +QUERY="$1" +shift + +for folder in "$@" +do + cd "$folder" + for a in **/*.bib + do + egrep -A20 '^@[A-Za-z]*{ *'$QUERY "$a" | sed -n '1,/^\s*$/p' | egrep '\\url|\\href' | sed 's/.*{\(http[^{]*\)}.*/\1/g' | tr -d '{}' + done +done | sort | uniq + diff --git a/bibgeturls b/bibgeturls @@ -0,0 +1,9 @@ +#!/usr/bin/zsh + +FILE="$1" +shift + +grep '^@' "$FILE" | cut -d'{' -f2 | grep -v ':' | grep -v '=' | tr -dc 'a-z0-9\n' | +while read KEY; do + bibgeturl "$KEY" "$@" | sed "s/^/$KEY /" +done