# Will a "system call" wait until the command finishes?

**URL:** <https://www.ruby-forum.com/t/will-a-system-call-wait-until-the-command-finishes/129265>\
**Category:** Ruby\
**Created:** [February 15, 2008, 9:44pm UTC](https://www.ruby-forum.com/t/will-a-system-call-wait-until-the-command-finishes/129265 "2008-02-15T21:44:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sayoyo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@sayoyo](https://www.ruby-forum.com/u/sayoyo)\
**Post date:** [February 15, 2008, 9:44pm UTC](https://www.ruby-forum.com/t/will-a-system-call-wait-until-the-command-finishes/129265/1 "2008-02-15T21:44:57Z")

</div>

Hi,

I wish to know, if I use system() to execute a time consuming task, will  
ruby wait until the task is finished or it will automatically interprete  
the next line?

Thanks you very much

sayoyo

---

<div class="post-metadata">

**Author:** ![sayoyo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@sayoyo](https://www.ruby-forum.com/u/sayoyo)\
**Post date:** [February 15, 2008, 9:51pm UTC](https://www.ruby-forum.com/t/will-a-system-call-wait-until-the-command-finishes/129265/2 "2008-02-15T21:51:27Z")

</div>

On Feb 15, 2:44 pm, sayoyo Sayoyo [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Posted viahttp://www.ruby-forum.com/.  
> it appears that Ruby will wait. try this  
> $ ruby -e ‘system(“sleep 5”);p “hi”’
