xargs -I{} sh -c 'pdflatex {}.tex && bibtex {} && pdflatex {}.tex && pdflatex {}.tex' <<< filename