1

I have a R script that was running on linux until today. So when I made a call to:

system("tail -f filename", intern = T)

it worked. But now, I have had to switch to windows. And it seems like I need to invoke shell (equivalent of system command) for that. But tail doesn't seem to work on windows. I tried the following but it failed:

shell("tail -f filename", intern = T)

Can someone help me how do I go about fixing it?

aajkaltak
  • 1,209
  • 4
  • 15
  • 27
  • 3
    You'll find it difficult to replicate the Unix `tail -f` functionality on vanilla Windows. The PowerShell command `Get-Content -Tail 0 -Wait` comes close, which I think you could invoke as `system("powershell -command \"Get-Content -Tail 0 -Wait filename\"",intern=T);`, but that may not behave the same way; see http://stackoverflow.com/questions/187587/looking-for-a-windows-equivalent-of-the-unix-tail-command. I recommend installing one of Cygwin, MingW, or GNU Utilities for Win32 which provide Unix equivalent utilities on Windows. – bgoldst Mar 09 '16 at 12:37

0 Answers0