#!/usr/bin/env python3
import sys,configparser,os

#if anything goes wrong, just output bash comment line
try:
   config=configparser.ConfigParser()
   fname=sys.argv[1]
   config.read(sys.argv[1])
   for section in config.sections():
      for name,value in config.items(section):
         print("export "+"_".join(section.split())+'_'+"_".join(name.split())+'="'+value+'"'+" ;")

except:
   print('# recommended usage: eval `'+sys.argv[0]+' python_ini_style_conf_file`')

