Invoke shell script in cgi script

Hi,
I just tried to call a simple shell script from a cgi script writing in c programming.But,it is not working.i will be grateful if anyone can show me the problems going on as i m new to c and oso shell script.Thanks.

-Here is my shell script of call the 'pc shut down' system command in ubuntu linux:-
shellscript name:myscript
#!/bin/sh/
echo "Type 'y' to shutdown,or any other ket to cancel"
read INPUT
if["$INPUT="y"];then
shutdown -h now
else exit
fi

-Below is my cgi script:-
#include <stdio.h>
#include "cgic.h"
#include <string.h>
#include <stdlib.h>
// Required by for routine
#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>

void HandleSubmit();
void ShowForm();

int cgiMain() {
cgiHeaderContentType("text/html");
/* Top of the page /
fprintf(cgiOut, "<HTML><HEAD>\n");
fprintf(cgiOut, "<TITLE>demo</TITLE></HEAD>\n");
fprintf(cgiOut, "<BODY bgcolor=\"#c0c0c0\">\n");
/
If a submit button has already been clicked, act on the
submission of the form. /
if ((cgiFormSubmitClicked("shutdown") == cgiFormSuccess))
HandleSubmit();
/
Now show the form /
else{
ShowForm();
}
/
Finish up the page */
fprintf(cgiOut, "</BODY></HTML>\n");
return 0;
}

void HandleSubmit()
{
int pid = -1;
pid = fork();
if(pid ==0){
//child process
fprintf(cgiOut, "This is child process<br/>");
char args[] = {"/sbin/shutdown", "-h", "now", "2>&1", (char)0};
if(execv("/sbin/shutdown -h", args)==-1)
fprintf(cgiOut, "<br/>execv failed");

}
else{
fprintf(cgiOut, "<strong><font color=\"#000066\">Operating system is shutting down......<br/>\n");
fprintf(cgiOut, "Please close your web broswer</font></strong>");
exec("myscript");
int status;
waitpid(pid, &status, WNOHANG);
}
}

void ShowForm()
{
fprintf(cgiOut, "<!-- 2.0: multipart/form-data is required for file uploads. -->");
fprintf(cgiOut, "<strong><font color=\"red\">Notice:<br/></font>\n");
fprintf(cgiOut, "By clicking the \"Shutdown\" button, the server operating system<br/>\n");
fprintf(cgiOut, "< will be shutting down/strong><br/>\n");
fprintf(cgiOut, "<form method=\"POST\" enctype=\"multipart/form-data\" ");
fprintf(cgiOut, " action=\"");
cgiValueEscape(cgiScriptName);
fprintf(cgiOut, "\">\n");
fprintf(cgiOut, "<input type=\"submit\" name=\"shutdown\" value=\"Shutdown\">\n");
fprintf(cgiOut, "</form>\n");
}

Oh wow, you're making this hard on yourself.

What's the point of running the "myscript" command? In the lines above exec("myscript" you have execv("/sbin/shutdown ..."). That should be enough.

Why are you writing this in C? You could write the CGI program in a shell script.