-2

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?

1 Answer 1

3

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.