system function respond

P

Pavel Pvl

i understand that using system returns a boolean. but how can i get the
actual output from the system command?
 
T

Tim Hunter

Pavel said:
i understand that using system returns a boolean. but how can i get the
actual output from the system command?

Use backticks.

output = `command`
 
P

Pavel Pvl

Tim said:
Use backticks.

output = `command`

well the thing is that when using system, the output is a boolean bc it
returns whether the system command executed successfully
 
P

Pavel Pvl

ara.t.howard said:
stdout = `#{ command }`
status = $?.exitstatus

for more try

gem install session
gem install open4

etc.

a @ http://codeforpeople.com/

other way around (unless im wrong). i want the output rather then the
exit status. i tried this out but it still gave me only the exti status
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top