# net2sh - converts net programs into shell script mkfifo pipes pipes_fmt docs procs pipes1 pipes2 comments mkfifos procs_bg procs_named rmfifos wait classs '#' docs '|' pipes '*' procs <&0 & # split fmt -w 1024 pipes_fmt & # 1line tee pipes1 pipes2 & # tee cat comments mkfifos procs_named wait rmfifos >&1 & # concat sed 's/^/#\t/' comments & # ins # sed 's/^/mkfifo\t/' mkfifos & # ins mkfifo sed 's/^/rm\t/' rmfifos & # ins rm sed 's/$/ \&/' procs_bg & # app & sed 's/\([^\t]*\)\t\(.*\)/\2\t# \1/' procs_named & # name to comment echo wait >wait & # write wait rm pipes pipes_fmt docs procs pipes1 pipes2 comments mkfifos procs_bg procs_named rmfifos wait