#!/bin/bash cd photoappend l=$(ls) for s in $l do x=$s y=$(echo $x | sed 's/_//g') y=$(echo $y | sed 's/-//g') if [ $x != $y ] then mv $x $y fi done