In shell script file im having list of linux commands…when running
script.sh file, second command (in script.sh file)it will ask user to
specify some details.I can specify these values when i run script.sh
file,while im running script.sh file in Terminal using sh script.sh.
But if i run script.sh file from ruby using exec"sh script.sh",i can
type in terminal…so i have to specify these values in ruby file
itself…
how to pass parameters from ruby file to that script.sh file?
On Wed, Jan 25, 2012 at 6:29 AM, Mahes karthick
[email protected] wrote:
In shell script file im having list of linux commands…when running
script.sh file, second command (in script.sh file)it will ask user to
specify some details.
This will actually read from stdin.
I can specify these values when i run script.sh
file,while im running script.sh file in Terminal using sh script.sh.
By typing, yes.
But if i run script.sh file from ruby using exec"sh script.sh",i can
type in terminal…
You can type in terminal when invoking the script with exec.
13:47:30 ~$ dash -c “read -p input: l;echo got $l”
input:abc
got abc
13:47:35 ~$ ruby19 -e ‘exec “dash”, “-c”, “read -p input: l;echo got
$l”’
input:def
got def
so i have to specify these values in ruby file itself…
I do not think so (see above).
how to pass parameters from ruby file to that script.sh file?
Passing parameters is a different story: parameters (aka “command line
arguments”) are passed with the execution, e.g.
13:42:30 ~$ time ruby19 -e ‘exec “/bin/sleep”, “5”’
real 0m6.150s
user 0m0.139s
sys 0m0.124s
13:42:40 ~$
So, what is your problem?
Kind regards
robert