SEGMENTS=$(cat streamindex-a1.m3u8) #echo $SEGMENTS for SEGMENT in $SEGMENTS; do echo "now downloading >>> $SEGMENT" curl $SEGMENT --output-dir -O ambient # this downloads all the segment files to a folder called latino done