SEGMENTS=$(cat stream.m3u8) #echo $SEGMENTS for SEGMENT in $SEGMENTS; do echo "now downloading >>> $SEGMENT" mkdir newmix # this makes a new folder # here we can download all the segments to curl $SEGMENT --output-dir newmix -O # this downloads all the segment files to a folder called latino done