My current prob开发者_JAVA技巧lem is that I'm developing a embedded system that uses a binary Cgi inside cgi-bin folder. For some obscure reason, when I access the browser and type /cgi-bin/Cgi?AjaxAction=settings&variable=0 everything works fine. So I would like to let a script boot with my application something like:
./Cgi < echo AjaxAction=settings&variable=0
But all my tries didn't worked out. I have PARTS of the Cgi code, and I know that it has no argc argv. Any thoughts on how to inject these parameters? I use PPC linux.
You should try setting the environment variable "QUERY_STRING":
setenv QUERY_STRING "AjaxAction=settings&variable=0"
and later that, simply execute the script:
./Cgi
Lot of cgi scripts uses that env variable to read the params sent in the url.
The script maybe use that way to read the vars.
Anyway, you should try to read the cgi code to see how it works... if you paste some here, maybe more people will be able to help you.
Hope it helps.
精彩评论