title: Shell script to join 5 or more json files together
body: <p>I am working on a project that has a lot of json documents in a large file lets call it manifest.json</p>
  
  <p>The files have titles such as  </p>
  
  <p>a-11.json</p>
  
  <pre><code>{"id":"a-11",
   "name":"XN0",
    "code":"H3A8FF82820F"
    "status":"live"
  } 
  </code></pre>
  
  <p>a-03.json</p>
  
  <pre><code>{"id":"a-03",
   "name":"PF1",
    "code":"FFFF82820F"
    "status":"live"
  }
  </code></pre>
  
  <p>a-09.json</p>
  
  <pre><code>{"id":"a-09",
   "name":"PF1",
   "code":"FFFF82820F"
   "status":"live"
  } 
  </code></pre>
  
  <p>What I want a shell script to do is to concatenate them all in alpha order and I am also need to wrap them like this:
      [
      {json doc},
      {json doc},
      {json doc
      ] 
  with a sq bracket seperated with a ,  so that it looks like the code below-</p>
  
  <p>The join command only connects two files so thats not going to work and I have tried a combination of cat and ls but it all goes a bit wrong.  I am trying to use the Linux environment rather than the MS environment here.</p>
  
  <p>manifest.json</p>
  
  <pre><code>[
  {"id":"a-03",
   "name":"PF1",
    "code":"FFFF82820F"
    "status":"live"
  },
  {"id":"a-09",
   "name":"PF1",
    "code":"FFFF82820F"
    "status":"live"
  }, 
  {"id":"a-11",
   "name":"XN0",
    "code":"H3A8FF82820F"
    "status":"live"
  }
  
  ]
  </code></pre>
  
  <p>The command</p>
  
  <pre><code>cat a-*.json &gt; manifest.json
  </code></pre>
  
  <p>Gives me the following with the a-11.json doc at the top, any help appreciated.</p>
  
  <pre><code>[
  {"id":"a-11",
   "name":"XN0",
    "code":"H3A8FF82820F"
    "status":"live"
  }
  {"id":"a-03",
   "name":"PF1",
    "code":"FFFF82820F"
    "status":"live"
  },
  {"id":"a-09",
   "name":"PF1",
    "code":"FFFF82820F"
    "status":"live"
  }, 
  
  ]
  </code></pre>