Created
December 27, 2018 17:59
-
-
Save Pk13055/dce290dc9cf1a9aaa68713edb1c2571f to your computer and use it in GitHub Desktop.
Revisions
-
Pk13055 created this gist
Dec 27, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ #!/bin/bash url=$1 file_size=`curl -sI "$1" | grep "Content-Length" | head -n 1 | cut -d ':' -f 2 | cut -d " " -f 2 | sed "s|\r||g"` length_of_each_part=`echo $((file_size/10))` start=0 end=$length_of_each_part for i in {1..10} do curl -s --range $start-$end -o /tmp/movie.part."$i" "$url" & start=$((end+1)) end=$((end+length_of_each_part)) done