#!/bin/bash for i in "$@" do if jhead "$i" | grep -q 'EOS 40D'; then mv "$i" "${i%%.jpg}"-daniel.jpg echo "$i (daniel)" else echo "$i" fi done