I am new to ruby and trying to do some command line stuff.
Now I need to save the output of
exec 'cat /etc/system-release'
in a variable to scan it for a number.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to grab the output you’re better off using
systemor backticks (or for longer running tasks,IO.popen)In this case, it would be a lot faster to do
rather than creating extra processes just to do this.