Files
doc_phd_thesis/References/generateReferenceFileList.bash
2019-02-10 21:36:25 +00:00

19 lines
411 B
Bash
Executable File

#!/bin/bash
OUT_FILE="References.tex"
REF_PATH="."
if [[ $# -ge 1 ]]
then
REF_PATH=$1
fi
# REF_PATH=$( realpath ${REF_PATH} )
echo "Searching on $REF_PATH"
echo "\bibliographystyle{IEEEtran}" > $OUT_FILE
echo -n "\bibliography{" >> $OUT_FILE
echo -n "$( find $REF_PATH -maxdepth 1 -name "*bib" -printf "$REF_PATH/%f," | sed 's#\.bib##g' )" >> $OUT_FILE
echo "}" >> $OUT_FILE
sed -i 's/,}/}/g' ${OUT_FILE}