Added some small boring scripts and programs writen in few last years
[mirrors/Programs.git] / bash / bash-httpd / bhp / bhp
1 #!/bin/bash
2 #BHP - BASH Home Page - Engine
3
4 export BHP_LIB=$(dirname $0)'/bhplib.bhp';
5
6 exec=0;
7 cat "$1" | sed -e 's/<?bhp/\n<?bhp\n/g;s/?>/\n?>\n/g' | while read line; do
8 case "$line" in
9 '<?bhp') exec=1; continue ;;
10 '?>') exec=0; continue ;;
11 '') continue ;;
12 esac
13 case $exec in
14 1) echo "$line" ;;
15 0) echo "echo '"$( echo "$line" | sed -e "s/'/'\\\\''/g" )"'" ;;
16 esac
17 done | bash
18
This page took 0.270617 seconds and 4 git commands to generate.