Forum: NGINX Passing arguments to os.execute()

2974d09ac2541e892966b762aad84943?d=identicon&s=25 tsunny (Guest)
on 2014-06-19 08:58
(Received via mailing list)
Hello,

How to send the value of a variable to a shell program using
os.execute()?

I want to send the value of $uri to my shell program. Below is my code,

location / {

   set_by_lua $result 'os.execute("/tmp/test.sh $uri")';

}

If I access $1 in my program, the value is just 'uri' not the value of
the
'$uri'.

Can please anyone tell me how to do this correctly.

Thanks

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,251038,251038#msg-251038
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.