Re: [R] Using system to run a stand alone program that requires input in Windows

From: Dr Carbon <drcarbon_at_gmail.com>
Date: Fri 15 Jul 2005 - 04:47:34 EST

Well, I'm confused because I tried to cook up an exaple and it appears to work as I think it should. If I have a simple script named myInput.bat:
@echo off
echo Enter y
set /p Input=
if /i "%Input%"=="y" (goto Proceed)
echo y not entered
exit /b
:Proceed
echo y entered

and a text file with just a y in it called y.txt then this works:
> system("myInput < y.txt", show.output.on.console = T)
Enter y
y entered
>

So, I'm baffled.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jul 15 04:53:44 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:42 EST