title: Passing a variable to PhantomJS via exec
body: <p>I'm getting started with Grunt and wanting to pass a variable to a PhantomJS script I'm running via exec. What I want to be able to do is pass a url in for the script to take the screen capture from. Any help would be greatly appreciated, thanks!</p>
  
  <p>Darren</p>
  
  <p><strong>Grunt script</strong></p>
  
  <pre><code>exec('phantomjs screenshot.js',
      function (error, stdout, stderr) {
          // Handle output
      }
  );
  </code></pre>
  
  <p><strong>screenshot.js</strong></p>
  
  <pre><code>var page = require('webpage').create();
  page.open('http://google.com', function () {
      page.render('google.png');
      phantom.exit();
  });
  </code></pre>