From: Dhiraj Girdhar Date: 2007-04-26T20:29:21+09:00 Subject: Re: How to run script file using system command Ari Brown wrote: > On Apr 26, 2007, at 2:04 AM, Dhiraj Girdhar wrote: > >> Hi, >> I am trying to run a script file using system command, but it is not >> working. >> >> Code... test.rb >> >> abc = system(". /export/home/dhiraj/scriptfile.sh") >> puts abc > The problem is right here. system doesn't need a puts to be used, so > when you try to puts the value of a block (a block of code, and the > block is abc = system("./export/home/dhiraj/scriptfile.sh")), you get > false. It doesn't have a value. You can just have it say: > > system("./export/home/dhiraj/scriptfile.sh") > > and it will work. > > If this made any sense, > HTH > > -------------------------------------------------------| > ~ Ari > crap my sig won't fit Hello Ari Here variable abc is ued to collect the return value of system command as system command returns some value. Return value of system states that whether the command executed successfully or not. Dhiraj -- Posted via http://www.ruby-forum.com/.