2008/9/25 Peter Dalgaard <[EMAIL PROTECTED]>: > John Chambers wrote: >> >> My application, at least, wanted to show (my class) individual commands >> from the file and then optionally insert some typed commands before going on >> to the next part of the source file. As far as I can see, the piped shell >> command approach will have to treat the whole file at one time. > > Hmmno... You can "cat -" multiple times if you want, terminating each with > ctrl-D. That's not to say that it is the optimal solution though. Echoing > the non-keyboard input seems a bit tricky, for instance.
Yes, looking more into it, the fact that everything gets echoed this way is less than ideal. And for some reason, presumably to do with the details of the behaviour of "cat", if I do (echo 'print(readline("Input:"));q()'; cat -) | R --interactive --no-save I need an extra newline after giving the input before I get returned to the shell, even though R seems to have quit already. So I don't think this is the answer. The "demoSource" approach is interesting, but I think running two R sessions is also going to be problematic for my application. It really would be nice if R could do this kind of thing itself. I would have thought it would make creating some simple "pass-through" front-ends (like mine ;) ) very easy. I have very little knowledge of the R source though, so I acknowledge that it may not be an easy task. Jon ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel