sudhir kumar sudhir kumar - 2 months ago 12
Bash Question

Shell script for ruby scripts execution

I have a ruby script name analysis and I am executing from bash by passing parameters

#!/usr/bin/env ruby
script here


execution:

./analysis -d parameter1 -p parameter2 parameter3


I execute this script multiple times by passing different parameters each time.
Is there is a way to execute these multiple ruby scripts from shell script?

Answer

A shell script like this should work:

# Execute Ruby script multiple times with different parameters.

ruby ./analysis.rb -d parameter1 -p parameter2 parameter3
ruby ./analysis.rb -d parameter4 -p parameter5 parameter6
ruby ./analysis.rb -d parameter7 -p parameter8 parameter9