Peel and slice the onions into thin longitudinal pieces. Wash the tamarind and soak it in ¼ cup of water.
Dry fry the onions in a pan without adding oil for about two minutes. Add ¼ tsp of salt, and ½ tsp of sugar. When all the water in the pan evaporates and the onions become bit translucent and start browning a bit, add the oil.
Fry for a minute and add the curry leaves, cinnamon, cardamom and cloves.
Saute this for a minute, and add the turmeric and chilly powders, as well as tamarind water (squeezed out from the soaked tamarind). Add salt as per need and close the vessel with a lid so that the contents get cooked well.
Switch off the stove once all the water evaporates. Serve this with string hoppers, bread, rice, chapati or dosa.