I''m trying to fix a bug in facter so that I can submit a patch and all, but I''m in need of some good documentation of this code construct. Unfortunately, every search engine I know of strips out such symbols. I''ve deduced that it calls an external command and captures stdout, but need more details, like can I get the PID of the sub-process? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John Florian wrote:> I''m trying to fix a bug in facter so that I can submit a patch and > all, but I''m in need of some good documentation of this code > construct. Unfortunately, every search engine I know of strips out > such symbols. I''ve deduced that it calls an external command and > captures stdout, but need more details, like can I get the PID of the > sub-process?The call is part of the Kernel class. See http://blog.jayfields.com/2006/06/ruby-kernel-system-exec-and-x.html. Also http://pasadenarb.com/2007/03/ruby-shell-commands.html is a good start as well as http://blog.dalethatcher.com/2008/05/ruby-debugging-backticks.html and http://clockobj.co.uk/2007/10/07/tip-running-command-line-shell-commands-in-ruby-using-x/ Regards James Turnbull - -- Author of: * Pro Linux Systems Administration (http://www.amazon.com/gp/product/1430219122/) * Pulling Strings with Puppet (http://www.amazon.com/gp/product/1590599780/) * Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) * Hardening Linux (http://www.amazon.com/gp/product/1590594444/) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFKFIT09hTGvAxC30ARAkumAJ45WThXPcCX4zQA2Lx/RsCEyitaogCdHL/b mMIecMMREzFlEX+R5XJVyhw=uhjl -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
2009/5/20 John Florian <john.florian@dart.biz>:> > I''m trying to fix a bug in facter so that I can submit a patch and > all, but I''m in need of some good documentation of this code > construct. Unfortunately, every search engine I know of strips out > such symbols. I''ve deduced that it calls an external command and > captures stdout, but need more details, like can I get the PID of the > sub-process?%{x} modifies the global $? which is a Process::Status http://www.ruby-doc.org/core/classes/Process/Status.html That has a pid, but you need to access it close to the execution point. Out of curiosity which bug? Paul --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---