Often I have to annotate multiple pdf documents using xournal. If I start with a directory of fresh pdf files, I just open them all with xournal:for f in *pdf; do xournal $f&; doneWhen I begin to annotate a file, say a .pdf I save it as a .xoj, i.e. I just switch the file extension. Now suppose I have an interrupted session and want to open all .pdf files in the directory provided that no corresponding .xoj file exists and open the .xoj file otherwise (both with xournal).How can I do this in command line? 
Prefer file types in command line
bash;files;zsh
You can just remove .pdf to get the file's name without the extension and check for a file of that name with the .xoj extension:for f in *.pdfdo    if [ -f ${f%.pdf}.xoj ]    then        xournal ${f%.pdf}.xoj &    else        xournal ${f} &    fidone