#!/bin/sh for file in $* ; do no_ext=`echo $file | sed -e 's/\.mpv\.mpg$//'` echo mv $file ${no_ext}.mpg done