# Passing arguments to os.execute()

**URL:** <https://www.ruby-forum.com/t/passing-arguments-to-os-execute/230465>\
**Category:** NGINX\
**Created:** [June 19, 2014, 8:58am UTC](https://www.ruby-forum.com/t/passing-arguments-to-os-execute/230465 "2014-06-19T08:58:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason\_sam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7993a0/32.png) [@jason\_sam](https://www.ruby-forum.com/u/jason_sam)\
**Post date:** [June 19, 2014, 8:58am UTC](https://www.ruby-forum.com/t/passing-arguments-to-os-execute/230465/1 "2014-06-19T08:58:01Z")

</div>

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:

> **[Passing arguments to os.execute()](https://forum.nginx.org/read.php?2,251038,251038#msg-251038)**
>
> 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")';
