From: Robert Klemme Date: 2012-01-25T21:48:28+09:00 Subject: Re: how to pass parameters from ruby file to shell script file On Wed, Jan 25, 2012 at 6:29 AM, Mahes karthick 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 -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/