# File lib/facter/util/resolution.rb, line 117
117:   def self.exec(code, interpreter = nil)
118:     Facter.warnonce "The interpreter parameter to 'exec' is deprecated and will be removed in a future version." if interpreter
119: 
120:     if expanded_code = expand_command(code)
121:       # if we can find the binary, we'll run the command with the expanded path to the binary
122:       code = expanded_code
123:     else
124:       # if we cannot find the binary return nil on posix. On windows we'll still try to run the
125:       # command in case it is a shell-builtin. In case it is not, windows will raise Errno::ENOENT
126:       return nil unless Facter::Util::Config.is_windows?
127:       return nil if absolute_path?(code)
128:     end
129: 
130:     out = nil
131: 
132:     begin
133:       out = %x{#{code}}.chomp
134:       Facter.warnonce 'Using Facter::Util::Resolution.exec with a shell built-in is deprecated. Most built-ins can be replaced with native ruby commands. If you really have to run a built-in, pass "cmd /c your_builtin" as a command' unless expanded_code
135:     rescue Errno::ENOENT => detail
136:       # command not found on Windows
137:       return nil
138:     rescue => detail
139:       $stderr.puts detail
140:       return nil
141:     end
142: 
143:     if out == ""
144:       return nil
145:     else
146:       return out
147:     end
148:   end