gitea ssh testing

This commit is contained in:
ackman678
2019-10-18 17:08:35 -07:00
parent 248a02090a
commit de62e9a1e6

18
urlconv.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
if [ "$1" == "-h" ] ; then
echo "
urlconv - add blob to ipfs and convert corresponding referring url in a bibtex database file
Usage: urlconv preprint.pdf references.bib
"
#echo "$(tput setaf 6)$EDITOR $(tput setaf 7)is currently set as editor"
exit 0
fi
fn=$1
bibFile=$2
relPath="ipfs://"
hashid=$(ipfs add $fn | grep $fn | cut --delimiter=" " -f 2)
sed -i -E "s|(\W*Url = \{).*$fn(\}.*)|\1$relPath$hashid\2|" $bibFile