#!/bin/bash # FILE=REG_20110727.csv if [[ $FILE =~ csv$ ]] then echo "File ends .csv" else echo "File does not end .csv, so adding extension." #mv ${FILE} ${FILE}.csv fi