#!/bin/bash cd $1 for i in *.ans;do mv $i `basename -s .ans $i`.out; done;