Commit | Line | Data |
---|---|---|
21c4e167 H |
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 |