tFix abbreviation of author names with accents - scholarref - tools for DOI and… | |
git clone git://src.adamsgaard.dk/scholarref | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 866570b4016c579141ed807c3e9719f82b65bc45 | |
parent 135d7c53f50e6696b5be7635a229374d2696a498 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Fri, 15 Nov 2019 18:15:56 +0100 | |
Fix abbreviation of author names with accents | |
Diffstat: | |
M getref | 17 +++++++++-------- | |
1 file changed, 9 insertions(+), 8 deletions(-) | |
--- | |
diff --git a/getref b/getref | |
t@@ -90,7 +90,7 @@ abbreviate_journal_name() { | |
} | |
abbreviate_author_name() { | |
- sed -e '/author = /{' -e 's/\([A-Z]\)[^[:space:]]* \([A-Z]\)/\1. \2/g'… | |
+ sed -e '/author = /{' -e 's/\([A-Z]\)[^ ]* \([A-Z]\)/\1. \2/g' -e '}' | |
} | |
strip_doi() { | |
t@@ -101,18 +101,19 @@ get_citation() { | |
doi=$(echo "$1" | strip_doi) | |
url="$host/$1" | |
[ "$verbose" = 1 ] && echo "connecting to $url" || : | |
- result=$($prefix curl --location \ | |
+ echo "$url" | |
+ result="$($prefix curl --location \ | |
--header "Accept: application/x-bibtex" \ | |
- --silent --show-error "$url") | |
+ --silent --show-error "$url")" | |
echo "$result" | grep -q '<html>' && die 'no result found' | |
- result="$(echo "$result" | format_bibtex_key)" | |
- [ "$fulljournal" = 0 ] && result="$(echo "$result" | abbreviate_journa… | |
- [ "$fullauthor" = 0 ] && result="$(echo "$result" | abbreviate_author_… | |
- result="$(echo "$result" | grep -v -e 'url = ' -e 'month = ' )" | |
+ result="$(printf "%s\n" "$result" | format_bibtex_key)" | |
+ [ "$fulljournal" = 0 ] && result="$(printf "%s\n" "$result" | abbrevia… | |
+ [ "$fullauthor" = 0 ] && result="$(printf "%s\n" "$result" | abbreviat… | |
+ result="$(printf "%s\n" "$result" | grep -v -e 'url = ' -e 'month = ' … | |
if [ "$nonewline" = 1 ]; then | |
printf "\n%s" "$result" | |
else | |
- echo "$result" | |
+ printf "%s\n" "$result" | |
fi | |
[ "$notify" = 1 ] && notify-send "${0##*/}" "added: $(echo "$result" |… | |
} |