#!/bin/bash EXT=`echo "$1"|awk -F . '{print $NF}'` NAME=`basename $1 .$EXT` if [ -z "$2" ]; then echo "Usage: $0 " exit 1 fi