gitea ssh testing
This commit is contained in:
18
urlconv.sh
Normal file
18
urlconv.sh
Normal 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
|
||||
Reference in New Issue
Block a user