# Trying to run/install a list of files in order

**URL:** <https://www.ruby-forum.com/t/trying-to-run-install-a-list-of-files-in-order/153478>\
**Category:** Ruby\
**Created:** [November 17, 2008, 7:48pm UTC](https://www.ruby-forum.com/t/trying-to-run-install-a-list-of-files-in-order/153478 "2008-11-17T19:48:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chutenro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@chutenro](https://www.ruby-forum.com/u/chutenro)\
**Post date:** [November 17, 2008, 7:48pm UTC](https://www.ruby-forum.com/t/trying-to-run-install-a-list-of-files-in-order/153478/1 "2008-11-17T19:48:54Z")

</div>

I’m pretty new to this whole thing, so I apologize in advance if this is  
common knowledge.

I’m trying to get a ruby script to grab a list of files and run them all  
one after the other. The initial script will go to a page, download the  
list, then use the list to download each one and install it.

The problem is that the list is ever-changing and updating, so I need to  
be able to get the script to sort of loop through and, say:

Download $file1  
Run $file1  
($file1 is complete)  
Download $file2  
Run $file2  
etcetera

I’m stuck in 2 points. First, if the download list is 7 files one day  
and 3 files the next, how can I get the script to stop in the right  
place? Also, how will it know to only run one at a time and then move  
to the next one? How can I get the download script to know when one is  
done and it can move on?

Thanks.
