#! /bin/sh

#AbsolutePath="/home/tim/share/Web/public/Language/";
AbsolutePath="/app/Web/public/Language/";
#AbsolutePath=`pwd`"/public/Language/";
TotalFile="SimplifiedChinese.json";
TempFile="Temp.json";

rm -rf $AbsolutePath$TotalFile;

JsonFileArray=`ls $AbsolutePath"/SimplifiedChinese" | sort -n`;

echo "[" >> $AbsolutePath"/"$TempFile;
for Json in $JsonFileArray
do
    cat $AbsolutePath"/SimplifiedChinese/"$Json >> $AbsolutePath"/"$TempFile;
done
echo "]" >> $AbsolutePath"/"$TempFile;

cat $AbsolutePath"/"$TempFile | tr -d "\r\n" | tr -d "\n" | sed 's/}{/},{/g' > $AbsolutePath"/"$TotalFile;
rm -rf $AbsolutePath"/"$TempFile;
