R: send multiple commands to Windows' cmd - r

I think and hope this is super easy, but I am jsut too stupid/blind:
I want to use system and not only open the command-line of windows, but to perform a simple copy task within it:
system('cmd' , 'copy Frame_Ind* all.dat')
So I thought... I want to copy alle files which start with "Frame_Ind" together into one that is calles "all.dat".
Can you tell me how to prompt more than one command with system?
I know this is a weird workaround, but it would help me a lot! Thanks and Cheers,
Al

Try the following:
shell('copy Frame_Ind* all.dat')

Related

RDCOMClient log file

I have been using RDCOMClient for a while now to interact with vendor software. For the most part it has worked fine. Recently, however, I have the need to loop through many operations (several hundred). I am running into problems with the RDCOM.err file growing to a very large size (easily GBs). This file is put in C: with no apparent option to change that. Is there some way that I can suppress this output or specify another location for the file to go? I don't need any of the output in the file so suppressing it would be best.
EDIT: I tried to add to my script a file.remove but R has the file locked. The only way I can get the lock released is to restart R.
Thanks.
Setting the permissions to read only was going to be my suggested hack.
A slightly more elegant approach is to edit one line of the C code in the package in src/RUtils.h from
\#define errorLog(a,...) fprintf(getErrorFILE(), a, ##__VA_ARGS__); fflush(getErrorFILE());
to
\#define errorLog(a, ...) {}
However, I've pushed some simple updates to the package on github that add a writeErrors() function that one can use to toggle whether errors are written or not. So this allows this to be turned on and off dynamically.
So
library(RDCOMClient)
writeErrors(FALSE)
will turn off the error logging to the file.
I found a work around for this. I created the files C:\RDCOM.err and C:\RDCOM_server.err and marked them both as read-only. I am not sure if there is a better way to accomplish this, but for now I am running without logging.

How to call shell command via VAPI-XP-TEST

I have .py script that run from the cmd.
I want to execute it in quality center automatically (I understood that is done using the test type VAPI-XP-TEST) and to get indication of '"Pass"/"Fail".
How exactly I can do it?
Thanks.
Check this link: http://alm-help.saas.hpe.com/en/12.50/online_help/Content/UG/t_create_vapixp_scripts.htm
Also, VAPI-XP allows Python script. I have not used Python for VAPI-XP yet, but HP documentation in the above link I believe can help you get up to speed.

Run Rmarkdown.rmd outside R editor

I am still pretty new to R, but couldn't seem to find solution to my question.
It's quite simple:
I have a .rmd file written and ready to run, but instead of openning it from R or Rstudio, Is there a way I can knit it automatically without opening that file?
Please kindly guide me how should I do this, screenshot would be much appreciated!!
Thanks in advance!!
Added: So I took nrussell's advice and tried run that on my windows command line, but I am seeing "The filename, directory name, or volumn label syntax is incorrect". Thoughts? Thank you all for your comments!
did a cd RMD's path , then used #nrussell's code. and it worked.
Somehow, I couldn't use specified RMD file path such as C:\XXX\XXXX.rmd, but if I cd to there first, it worked.

Is there a way to use Expect-Lite variables inside of a spawned command?

I've been working on trying to automate the complicated process of building source code on a build machine and then transferring the compiled image files over to my embedded ARMv7 device to be flashed. Each step by itself is easy to automate with standard Linux Shell Script, but when trying to do everything in one giant script things get complicated. Thus far I've been using expect-lite to do the work, which is working except now I've run into a problem. When transferring the images over I have expect-lite code that looks like the following:
$imageDestination="/the/destination"
$imageSource="/the/source/"
>sftp $userName'#'$buildMachine
>$password
>get $imageSource'/'x-load_sdcard.bin.ift $imageDestination'/'MLO
>echo "Finished"
>bye
If you know a thing or two about expect-lite, then you'll know that the above variables will be read as "Shell" variables. The problem is that as far as I know SFTP doesn't allow the use of variables. Is there a way to tell expect-lite to use the predefined variables instead of trying to use "Shell" variables? Or, is there some cleaver way to get around this limitation without removing the variables?
All help is greatly appreciated.
Dreligor,
There is no scope issue. Expect-lite variables are all of global scope (as stated in the documentation). I think the problem is that you are using quotes which is making things more difficult. You should try:
$imageDestination=/the/destination
$imageSource=/the/source
>sftp $userName'#'$buildMachine
>$password
>get $imageSource/x-load_sdcard.bin.ift $imageDestination/MLO
>echo "Finished"
>bye
Craig Miller - author and maintainer of expect-lite
After some experimentation it turns out that this is a scope issue. The solution is to simply move the variable declarations down. They need to be declared after the script has connected to the remote machine via sftp. The fixed code is as follows:
>sftp $userName'#'$buildMachine
>$password
$imageDestination="/the/destination"
$imageSource="/the/source/"
>get $imageSource'/'x-load_sdcard.bin.ift $imageDestination'/'MLO
>echo "Finished"
>bye
Hopefully this will help others.

What are the ways to create an executable from R program

I want to know if there is anyway of creating an executable R program to be run in UNIX. I think RInside will do the job but just want to know if there is any other way of doing this.
Thanks in Advance
The exact answer depends on your requirements, but you can start by looking at Rscript (see http://stat.ethz.ch/R-manual/R-devel/library/utils/html/Rscript.html and http://blog.revolutionanalytics.com/2009/01/using-r-as-a-scripting-language-with-rscript.html), as well as littler (http://code.google.com/p/littler/).

Resources