0

I was trying to invoke Cygwin from within R with the following command:

shell("cd C:\\cygwin\\bin & bash --login -i testfile2.txt", intern = T)

Within Cygwin I tried to invoke another program (Church). The invokation is in the testfile2.txt and looks like this:

/cygdrive/c/cygwin/home/$USER/jschurch/bher /cygdrive/c/cygwin/home/$USER/foo.church > /cygdrive/c/cygwin/home/$USER/output.txt

However, I get the following error messages:

> shell("@echo on & cd C:\\cygwin\\bin & bash --login -i testfile2.txt", intern = T)
 [1] "bash: cannot set terminal process group (-1): Inappropriate ioctl for device"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
 [2] "bash: no job control in this shell"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
 [3] "Unhandled exception:"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
 [4] " Condition components:"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
 [5] "   1. &error"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
 [6] "   2. &who: expander"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
 [7] "   3. &message: \"cannot locate library in library-path\""                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
 [8] "   4. &library-resolution:"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
 [9] "       library: (scheme-tools srfi-compat :1)"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
[10] "       files: (\"./scheme-tools/srfi-compat/%3a1/main.vicare.sls\" \"./scheme-tools/srfi-compat/%3a1/main.vicare.ss\" \"./scheme-tools/srfi-compat/%3a1/main.vicare.scm\" \"./scheme-tools/srfi-compat/%3a1/main.sls\" \"./scheme-tools/srfi-compat/%3a1/main.ss\" \"./scheme-tools/srfi-compat/%3a1/main.scm\" \"./scheme-tools/srfi-compat/%3a1.vicare.sls\" \"./scheme-tools/srfi-compat/%3a1.vicare.ss\" \"./scheme-tools/srfi-compat/%3a1.vicare.scm\" \"./scheme-tools/srfi-compat/%3a1.sls\" \"./scheme-tools/srfi-compat/%3a1.ss\" \"./scheme-tools/srfi-compat/%3a1.scm\" \"/usr/local/lib/vicare/scheme-tools/srfi-compat/%3a1/main.vicare.sls\" \"/usr/local/lib/vicare/scheme-tools/srfi-compat/%3a1/main.vicare.ss\" \"/usr/local/lib/vicare/scheme-tools/srfi-compat/%3a1/main.vicare.scm\" \"/usr/local/lib/vicare/scheme-tools/srfi-compat/%3a1/main.sls\" \"/usr/local/lib/vicare/scheme-tools/srfi-compat/%3a1/main.ss\" \"/usr/local/lib/vicare/scheme-tools/srfi-compat/%3a1/main.scm\" \"/usr/local/lib/vicare/scheme-tools/srfi-compat/%3a1.vicare.sls\" \"/usr/local/lib/vicare/scheme-tools/srfi-compat/%3a1.vicare.ss\" \"/usr/local/lib/vicare/scheme-tools/srfi-compat/%3a1.vicare.scm\" \"/usr/local/lib/vicare/scheme-tools/srfi-compat/%3a1.sls\" \"/usr/local/lib/vicare/scheme-tools/srfi-compat/%3a1.ss\" \"/usr/local/lib/vicare/scheme-tools/srfi-compat/%3a1.scm\")"

Can anyone explain me, how to handle this problem?

Thanks, David

sedsiv
  • 531
  • 1
  • 3
  • 15
  • Unless your commands run properly from a cmd.exe session directly, this is not an `R` question, nor is it likely to be a `cygwin` question. – Carl Witthoft May 17 '13 at 14:51
  • Have you seen [this question](http://stackoverflow.com/questions/5068264/cant-call-cygwin-commands-from-r)? – nograpes May 17 '13 at 17:51

1 Answers1

0

use the command c:\cygwin\bin\run.exe to launch cygwin processes from windows. It should clear up the issue.

run [ -p path ] command [ -wait ] arguments

With -p path you can add a path to the PATH environment variable.

Isaac Hanson
  • 1,088
  • 9
  • 14