Hi Arie,
> please have a look.
> I am still not very sure about the read STDIN until EOF.
Yes, the examples are a bit meaningless as they are now.
> I created a small script, but when is EOF of STDIN really signalled???
Concerning stdinread: You need an (in NIL ..), because when the script runs, the
*current* input channel is still the script itself (this is the nature of a Lisp
interpreter). So if you write
#!/usr/bin/picolisp /usr/lib/picolisp/lib.l
(in NIL
(println "Type a few lines and end with ctrl+d")
(setq Var (in NIL (till NIL T)))
(prinl Var)
(println "Program is finished!") )
(bye)
and then do
$ { echo abc; echo def; } | ./stdinread
"Type a few lines and end with ctrl+d"
abc
def
"Program is finished!"
Note that starting ./stdinread and then typing works but will not print any
output, because ^D terminates the interpreter.
The other examples are fine, aren't they?
♪♫ Alex
--
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe