I need to write a shell script which does the following:

script shld be in such a way that I just need to pass a parameter and it shld generate the report by running a sql script and store it in a directory and email this report in every 30mins .this shell script should pass a parameter (by calling a function) into a sql script and generate a report and I want the name of the report in a specific format.

can someone please pass on the script if anyone has it or let me know how to do this?

any help is appreciated!!

This shouldn't be overly difficult, but you really didn't provide enough information in your requirements.

What report should it generate? Or is this all done by the "SQL script"? And what SQL script is this that it's going to run? Do you already have it written? How is the script run? Is it PL/SQL? MySQL? Microsoft SQL? What is the format for the name of the script?

At first blush it sounds like what you really want is to just have a set of SQL scripts with your various reports, and then create cron jobs for them to run.