Go through the link, and write script for the given steps.
In reply to Re: Applying Patch by perldesire in thread Applying Patch by selva