#!/bin/bash for i in * ; do path="${i%%.*}" name="${path##*/}" echo "$path -> $name" ./cqm2dd $path.dsk mv image.dd $name.dd done