#!/bin/bash dir=/home/king while read line do my_dir="$dir/$line" if [ ! -d "$my_dir" ];then echo $my_dit mkdir $my_dir else echo "direc exist" fi { wget -c -p $my_dir $line #find m3u8 file while read line do #loop download ts file,verify ts echo test wget -c -p $my_dir something done<m3u8.index #merge ts file }& done<a.txt