Hi Alex, The reason is that I want to do scripting in PicoLisp (thank you so much for sharing it :-). Sometimes I need to call a shell script, which requires "interactive" input (and that I want it to still be "interactive").
Nothing occur when running: : (vi "file") -> NIL But using (call 'vi "file") works fine. Calling : (raw NIL) (call 'sh "-c" "echo -n 'name: '; read name; echo $name") (ra= w T) does not work too on my system. I notice that (raw NIL) does nothing. : (raw NIL) -> NIL : (raw) -> T Best regards, KS On Thu, May 7, 2009 at 7:08 PM, Alexander Burger <[email protected]> wrot= e: > Hi Kriangkrai, > >> When I run: (call 'sh "-c" "echo -n 'name: '; read name; echo $name") >> It outputs "name :" and waits for input. I type something (e.g. "abc") >> but nothing echo. I press the Enter key, nothing happens. I press >> Ctrl-J, then it prints "abc". > > Hmm, I cannot reproduce it in the same way, but I recognize that this is > a problem in general. In both cases when I either run it without line > editing: > > =A0 $ bin/picolisp > =A0 : (call 'sh "-c" "echo -n 'name: '; read name; echo $name") > =A0 name: > =A0 -> T > > or with: > > =A0 $ ./p dbg.l > =A0 : (call 'sh "-c" "echo -n 'name: '; read name; echo $name") > =A0 name: > =A0 -> T > > it immediately returns, meaning that the 'read' got EOF immediately. Not > sure if this is correct behavior. > > On the other hand, things like > > =A0 : (vi "file") > > work well. How is that in your case? > > >> It works fine, but after returning to PicoLisp prompt, line editing brok= e. >> How to solve this this problem? > > We could either insert setCooked() and setRaw() calls to the child part > of doCall() (not tried), or do it on the Lisp level: > > =A0 : (raw NIL) (call 'sh "-c" "echo -n 'name: '; read name; echo $name")= (raw T) > > This, however, does not show any different bahavior on my system. > > > What is actually the purpose of that call? > > Cheers, > - Alex > -- > UNSUBSCRIBE: mailto:[email protected]?subject=3dunsubscribe > -- UNSUBSCRIBE: mailto:[email protected]?subject=unsubscribe
