Loops…..

#!/bin/sh
#
# Convert Music On Hold to native codecs.
#
for y in ulaw alaw
do
    for x in /var/lib/asterisk/moh/*.gsm;
    do
        asterisk -rx "file convert $x /var/lib/asterisk/moh/`basename $x .gsm`.$y";
    done
done