From: Robert Dober Date: 2006-07-11T19:53:06+09:00 Subject: Re: Is possible to return after exec cmd? ------=_Part_121327_11431573.1152615181687 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 7/11/06, Petr Spisek wrote: > > Hi folks, > why doesn't work command 5.times{exec "pwd"} like this 5.times{puts > "Hello"} ? Because exec (as in the shell BTW) replaces your process with the program passed as argument. That is the ruby interpreter is replaced by pwd. What you want is probably system 5.times{ system "pwd" } Cheers Robert ollin > > -- > Posted via http://www.ruby-forum.com/. > > --=20 Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_121327_11431573.1152615181687--