FOLDER="ambient" SEGMENTS=$(ls $FOLDER/seg*.ogg) #echo $SEGMENTS for SEGMENT in $SEGMENTS; do SEGMENT_BN=$(basename $SEGMENT .ogg) echo " $SEGMENT " done