title: How to execute multiple shell commands using node.js?
body: <p>Maybe I haven't groked the asynchronous paradigm yet, but I want to do something like this:</p>
  
  <pre><code>var exec, start;
  exec = require('child_process').exec;
  start = function() {
    return exec("wc -l file1 | cut -f1 -d' '", function(error, f1_length) {
      return exec("wc -l file2 | cut -f1 -d' '", function(error, f2_length) {
        return exec("wc -l file3 | cut -f1 -d' '", function(error, f3_length) {
          return do_something_with(f1_length, f2_length, f3_length);
        });
      });
    });
  };
  </code></pre>
  
  <p>It seems a little weird to keep nesting those callbacks every time I want to add a new shell command. Isn't there a better way to do it?</p>