Welcome! Log In Create A New Profile

Advanced

Passing arguments to os.execute()

June 19, 2014 02:57AM
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
Subject Author Posted

Passing arguments to os.execute()

tsunny June 19, 2014 02:57AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 75
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready