scsh-users
[Top] [All Lists]

help understand a script

To: scsh@zurich.csail.mit.edu
Subject: help understand a script
From: ZHAO Wei <zhaoway@public1.ptt.js.cn>
Date: Sat, 01 Nov 2003 12:53:07 +0800
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


<Prev in Thread] Current Thread [Next in Thread>