title: How to get a linux command output to chef attribute
body: <p>I want to get a command output into a chef attribute. Can some one help me how to set that in execute resource or bash resource.</p>
  
  <pre><code>ruby_block "something" do
      block do
          #tricky way to load this Chef::Mixin::ShellOut utilities
          Chef::Resource::RubyBlock.send(:include, Chef::Mixin::ShellOut)      
          command = 'cat #{fileName}'
          command_out = shell_out(command)
          node.set['my_attribute'] = command_out.stdout
      end
      action :create
  end
  </code></pre>
  
  <p>How to use attributes in the above code..</p>