From: "Carlo E. Prelz" Date: 2013-05-23T14:28:41+09:00 Subject: Re: newbie question on using system syntax versus backticks Subject: newbie question on using system syntax versus backticks Date: gio 23 mag 13 11:22:47 +0900 Sorry for the delay! Quoting Thomas Luedeke (lists@ruby-forum.com): > I keep running into this, and change my approach if undesirable effects > are encountered. But what I'd like to systematically understand is the > difference between issuing a system command such as: > > system( "some_system_command" ) > > and simply doing it with backticks: > > `some_system_command` There is one fundamental difference: backticks return the output of the command, while system() lets the output be shown on screen (or wherever your stdout/stderr point to) and returns true or false, according to whether the command returned with a zero (success) or non-zero (failure) status. If you have v1=`date` v2=system('date') v1 will contain something like "gio 23 mag 2013, 07.23.01, CEST\n", while v2 will contain true. Apart from that, as far as I know the command is executed in the same way. Carlo -- * Se la Strada e la sua Virtu' non fossero state messe da parte, * K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)