# Ngx\_echo v0.28: support for the -n and -- options

**URL:** <https://www.ruby-forum.com/t/ngx-echo-v0-28-support-for-the-n-and-options/187962>\
**Category:** NGINX\
**Created:** [May 3, 2010, 11:45am UTC](https://www.ruby-forum.com/t/ngx-echo-v0-28-support-for-the-n-and-options/187962 "2010-05-03T11:45:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![agentzh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4da419/32.png) [@agentzh](https://www.ruby-forum.com/u/agentzh)\
**Post date:** [May 3, 2010, 11:45am UTC](https://www.ruby-forum.com/t/ngx-echo-v0-28-support-for-the-n-and-options/187962/1 "2010-05-03T11:45:52Z")

</div>

Hi, folks!

I’m happy to announce the v0.28 release of our ngx\_echo module:

```
 http://github.com/agentzh/echo-nginx-module/tarball/v0.28

```

Ngx\_echo is a powerful nginx module that wraps lots of Nginx internal  
APIs for streaming input and output, parallel/sequential subrequests,  
timers and sleeping, as well as various meta data accessing. Basically  
it provides various utilities that help testing and debugging of other  
modules by trivially emulating different kinds of faked subrequest  
locations.

The highlight of this version is the introduction of new options “-n”  
and “–” for the “echo”, “echo\_before\_body”, and “echo\_after\_body”  
directives.

Now we can suppress the trailing newline character in the “echo”  
output by using the -n option, as in

```
location /echo {
    echo -n "hello, ";
    echo "world";
}

```

Accessing /echo gives

```
$ curl 'http://localhost/echo'
hello, world

```

Leading -n in variable values won’t take effect and will be emitted  
literally, as in

```
location /echo {
    set $opt -n;
    echo $opt "hello, ";
    echo "world";
}

```

This gives the following output

```
$ curl 'http://localhost/echo'
-n hello, world

```

One can also output leading -n literals and other options using the  
special – option like this

```
location /echo {
    echo -- -n is an option;
}

```

which yields

```
$ curl 'http://localhost/echo'
-n is an option

```

Please see the documentation for more details:

```
http://wiki.nginx.org/NginxHttpEchoModule#echo

```

I must thank Dylan S. and kindy for prompting me to add the -n  
option. They have even provided patches on their own but their patches  
required more treatment before merging into the mainstream 🙂

In the next release, i.e., v0.29, I’ll refactor the implementation of  
the echo\_location, echo\_subrequest, and echo\_sleep as promised in  
another thread of this list.

Enjoy!  
-agentzh
