added tips to lamer.bash help
[mirrors/Programs.git] / bash / bhttpd / httpd.bash
... / ...
CommitLineData
1#!/bin/bash
2ififo="/tmp/$$.osck";
3ofifo="/tmp/$$.isck";
4mkfifo "$ififo";
5mkfifo "$ofifo";
6
7passfifo() {
8 while true; do
9 cat "%1";
10 done
11}
12
13while true; do
14 echo -ne 'HTTP/1.1 200 OK\n\n' > "$ofifo";
15 passfifo "$ofifo" | nc -l -p 8080 > "$ififo" &
16 cat "$ififo" | head -n 1 | cut -d ' ' -f 2 | read line;
17 echo "$line";
18 echo "$line" > "$ofifo";
19 kill "$!";
20done;
This page took 0.405018 seconds and 4 git commands to generate.