You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Werner Schalk <we...@gmx.de> on 2002/08/17 18:04:02 UTC

output filter problems

Hello,

I'm currently playing with output
filters. I thought of using awk
to print out the number
of each line. In my bash shell I
used this:

echo "<html>" | awk '{print NR ":" $1}'

I add the following lines to my httpd.conf:
ExtFilterDefine awk_line_numbering mode=output outtype=text/html
cmd="/bin/awk '{print NR": " $N}'"
<Location />
SetOutputFilter awk_line_numbering
</Location>

Now when I start the apache I get a
syntax error (of course). 

Unexpected parameter: `: " $N}'"'

How can I solve this?
Using ' instead of " is not possible
with awk and typing a \ before the "
did not help either...

Bye and thanks,
Werner.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: output filter problems

Posted by Werner Schalk <we...@gmx.de>.
Hello,

including a backslash does not work,
I gonna submit a bug report together
with a friend of mine.

Bye,
Werner.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: output filter problems

Posted by Joshua Slive <jo...@slive.ca>.
Werner Schalk wrote:

> I add the following lines to my httpd.conf:
> ExtFilterDefine awk_line_numbering mode=output outtype=text/html
> cmd="/bin/awk '{print NR": " $N}'"

> Unexpected parameter: `: " $N}'"'
> 
> How can I solve this?
> Using ' instead of " is not possible
> with awk and typing a \ before the "
> did not help either...

1. I'm fairly sure that escaping using back-slash should work.  Try this 
again:
ExtFilterDefine awk_line_numbering mode=output outtype=text/html 
cmd="/bin/awk '{print NR\": \" $N}'"

If that doesn't work, you might want to report it as a bug.

2. Enclose your awk command in a small shell script and call the shell 
script.

Joshua.



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org