根据 kdd2019的 pdf文件, 生成索引文档. 代码如下:
for fname in ` ls pdfs/*.pdf`; do
title=$(mdls -name kMDItemTitle -raw $fname)
authors=`echo $(mdls -name kMDItemAuthors -raw $fname) | sed 's/(//g;s/)//g;s/"//g' `
keywords=`echo $(mdls -name kMDItemKeywords -raw $fname) | sed 's/(//g;s/)//g;s/"//g' `
if [ ! "$title" = "(null)" ] ; then
echo "* [$title]($fname)"
echo " - $authors"
echo " - $keywords"
fi
done
效果