Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to run several ruby scripts from the command line. Here is my code so far:

for i in {1..59}; do $("ruby sample$i.rb"); sleep 10; done

The purpose is to test all these scripts quickly, but I'm getting this error:

ruby sample1.rb: command not found

I have tried all the solutions listed here but no luck.

What should I do to run these scripts?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

why complicate ?

 for i in {1..59}; do ruby sample$i.rb; sleep 10; done

when you run : $("ruby sample$i.rb")

this means, run a command named "ruby sample1.rb" , then run output as command.

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.