#!/bin/bash if [ -z $1 ]; then echo "Usage: $0 " exit 1 fi OUTPUT=$1 rm -f $OUTPUT.temp liste=(`cat >$OUTPUT.temp else echo "Found an option ${liste[$i]} with value $value." echo -e "${liste[$i]}\t\"$value\"" >>$OUTPUT.temp fi check[$i]=1 fi fi ((i+=1)) done done IFS=$OLDIFS # output empty defaults for values not found i=0 while [ $i -lt ${#liste[*]} ]; do if [ ${check[$i]} -eq 0 ]; then echo -e "${liste[$i]}\t\"\"" >>$OUTPUT.temp fi ((i+=1)) done echo -e "#key\tvalue" >$OUTPUT sort $OUTPUT.temp | uniq >>$OUTPUT