mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

bibgeturl (322B)


      1 #!/usr/bin/zsh
      2 
      3 # find a URL for a paper from a messy collection of bib files
      4 
      5 QUERY="$1"
      6 shift
      7 
      8 for folder in "$@"
      9 do
     10   cd "$folder"
     11   for a in **/*.bib
     12   do
     13     egrep -A20 '^@[A-Za-z]*{ *'$QUERY "$a" | sed -n '1,/^\s*$/p' | egrep '\\url|\\href' | sed 's/.*{\(http[^{]*\)}.*/\1/g' | tr -d '{}'
     14   done
     15 done | sort | uniq
     16