title: how to capture output from rails runner "MyCloud::Deployment.checkuser" on a bash shell
body: <p>I want to capture the output on the bash shell when running the following command at the bash prompt.</p>
  
  <pre><code>rails runner "MyCloud::Deployment.checkuser"
  </code></pre>
  
  <p>Basically <code>checkuser()</code> returns a value of either 1 or 0, which I want to capture at the shell that launched the "rails runner" command.</p>
  
  <p>Based on the written value at the shell, I would like to execute some other command. This <code>checkuser()</code> connects to the cloud, accesses the SQL server and returns the value, so I need to load the rails env.</p>
  
  <p>I run this command in hudson "execute shell" window. How do I go about achieving this task?
  Does rake help me with this?</p>
  
  <p>Edit:</p>
  
  <pre>
  #to keep things simple:
  module MyCloud
    class Deployment
      def self.checkuser
        return 20
      end
    end
  end 
  
  I am running the command from ubuntu box:
  sreeni@ubuntu:~/work/co/RoR$ res="$(rails runner "MyCloud::Deployment.checkuser")"
  sreeni@ubuntu:~/work/co/RoR$ echo $res
  
  sreeni@ubuntu:~/work/co/RoR$
  
  </pre>
  
  <p>I want to capture the value that is returned from that check_user() to a variable on the bash shell.</p>