diff options
| -rwxr-xr-x | concurrent_dl.sh | 14 | 
1 files changed, 7 insertions, 7 deletions
diff --git a/concurrent_dl.sh b/concurrent_dl.sh index d2c9d36..b44b3d0 100755 --- a/concurrent_dl.sh +++ b/concurrent_dl.sh @@ -4,9 +4,9 @@ chunk=10  dl_safe()  {  	echo "$1 <- $2" -	if (echo $1 | grep '/' >/dev/null) && ! [ -d ${1%/*} ] +	if (echo $1 | grep '/' >/dev/null) && ! [ -d "${1%/*}" ]  	then -		mkdir -p ${1%/*} +		mkdir -p "${1%/*}"  	fi @@ -15,7 +15,7 @@ dl_safe()  	limit=10  	while [ $done -ne 0 ] && [ $i -lt $limit ]  	do -		curl --compressed --max-time 10 -sLo $1 $2 -H @$3 +		curl --compressed --max-time 10 -sLo "$1" "$2" -H "@$3"  		done=$?  		i=$((i+1))  	done @@ -43,9 +43,9 @@ strip_path()  		fi  	) -	if ! [ -d $outdir ] +	if ! [ -d "$outdir" ]  	then -		mkdir -p $outdir +		mkdir -p "$outdir"  	fi  }  concurrent_dl() @@ -98,9 +98,9 @@ concurrent_dl()  		pids=""  		read url  		o=$(echo "$url" | $filter) -		if ! [ -f $o ] +		if ! [ -f "$o" ]  		then -			dl_safe $o $url $headers & +			dl_safe "$o" "$url" "$headers" &  			pids="$pids $!"  		fi  		i=$((i+1))  | 
