i wanted to download a file using curl command simultaneously in different parts using ip aliasing(virtual Ethernet ports) so what i did was pasted the commands in a text file and run but the problem as obvious since it is in a file the commands will be executed one by one so is there a way to run all those commands simultaneously. here is the command

    curl --interface eth0:0 --range 0,38010880 http://wdl.cache.ijinshan.com/wps/download/Linux/unstable/kingsoft-office_9.1.0.4244~a12p3_i386.deb -o kinsoft-office.part1

    curl --interface eth0:1 --range 38010880 ,- http://wdl.cache.ijinshan.com/wps/download/Linux/unstable/kingsoft-office_9.1.0.4244~a12p3_i386.deb -o kinsoft-office.part2

    cat kinsoft-office.part*>kinsoft-office

can anyone help me to run these above 2 commands simultaneously from the script so as to increase download speed

share|improve this question
    
What's the problem with what you've got? – Oli Aug 21 '14 at 10:05
    
Adapt this script to your needs: github.com/murukeshm/scripts/blob/master/curlwc.sh – muru Aug 21 '14 at 10:09
up vote 1 down vote accepted

The general way of doing things in parallel is to launch each command asynchronously - to run in the background - by adding an ampersand & at the end of the command line.

Read up on job control in bash manpage and maybe also in the Advanced Bash-Scripting Guide (www.tldp.org)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.