#!/bin/bash for file in $folder/*.docx $folder/*.doc $folder/*.pdf do if [ -f $file ] then process "$file" fi done