The following script. I can't understand the output which is only two
"yes" without "haha". I think there should be a "haha" in the output.
Please help me clarify! Thank you!
#! /usr/bin/scsh \
-o threads -e main -s
!#
(define (main ignore)
(let* ((headache (lambda ()
(spawn (lambda ()
(run (begin (display "haha") (newline)))))))
(watcher (lambda ()
(awk (read-line) (line) ()
(#t (display line) (newline)
(headache)
(display line) (newline))))))
(run (| (echo "yes") (begin (watcher))))
(sleep (* 3600 1000))))
--
zhaoway@public1.ptt.js.cn
http://c2.com/cgi/wiki?ZhaoWay
http://advogato.org/person/zhaoway/
linux.ext2fs.tcp.ip.netfilter.gnu.debian.dpkg.rpm.bash.lex
yacc.gcc.lisp.scheme.ocaml.latex.html.css.php.apache.mysql
|