Today I needed to convert a bunch of RTF files (I know, what?) to PDFs. After stumbling through a bunch of dead ends, I realized this—like most things—could be done incredibly easily in Bash:
#!/bin/bash for file in *.rtf ; do filename=$(basename "$file") /usr/sbin/cupsfilter "$file" > "$filename.pdf" done