something like:

system("PWD=`pwd`; cd TARGETDIR; ./runme.sh; cd $PWD') will do basically this.

Every time you run the system call it should be spawning a new shell
with a fresh environment.

--e


On Tue, Oct 10, 2017 at 12:58 PM, Christofer Bogaso
<bogaso.christo...@gmail.com> wrote:
> Hi again,
>
> I need to execute few line of system codes for iOS from R. Basically
> that execution involves (as an example) :
>
> 1. Change the Working directory first
> 2. Execute some task (e.g.deleting a file)
> 3. Then go back to original folder/directory
>
> I am aware of system() function which can be used here. However it
> looks that system() function executes iOS code one-by-one i.e. after I
> execute system('cd .....') for #1 above, that changed directory is not
> passed for #2 and so on.
>
> Is there any way where I can run a chain on iOS code as-a-whole using R.
>
> Your help will be highly appreciated.
>
> Thanks for your time.
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

_______________________________________________
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to