#!/bin/ksh files="`ls`" for file in $files do part1="`echo $file|cut -f1 -d.|cut -c1-3`" part2="`echo $file|cut -f4 -d.|cut -c1-3`" wavmake "${part1}*${part2}" "${part1}_${part2}.wav" done