Hi Piyush.
This form of the script looks generally good to me. May be a good time to move to the second stage of the project, which if I am not mistaken consists in creating some dejagnu infrastructure so we can get testsuites running the script on the test sources. At this point it would be good if this and future series would be available in some public branch somewhere until the stuff is ready to go in the main gcc.git repository. Do you have access to some suitable forge or similar? Otherwise you may want to use forge.sourceware.org.