Json2json bash script

Rationale: service returns many independent RDF records. Script puts them in a common JSON array.

#!/bin/bash
# Jovanovic, 2013-01
# usage: ./json2json.sh ime
# read arguments from command line, 
# reformat the JSON for processing, write JSON file
 
perl -0777 -wpl -e 's/^/\[/;' $1-json \
| perl -0777 -wpl -e 's/,\n*$/\n\]\n/;' > $1.json