Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-11-04 Thread Tomas Kalibera
Thanks for the suggestions, I've updated the documentation. Tomas On 11/3/21 11:30 AM, Tomas Kalibera wrote: On 11/3/21 1:37 AM, Henrik Bengtsson wrote: Oh, I see, I misunderstood.  Thanks for clarifying. One more thing, to mix-and-match environment variables and strings with escaped characte

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-11-03 Thread Tomas Kalibera
On 11/3/21 1:37 AM, Henrik Bengtsson wrote: Oh, I see, I misunderstood. Thanks for clarifying. One more thing, to mix-and-match environment variables and strings with escaped characters, while mimicking how POSIX shells does it, by using strings with double and single quotes. For example, wit

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-11-02 Thread Henrik Bengtsson
Oh, I see, I misunderstood. Thanks for clarifying. One more thing, to mix-and-match environment variables and strings with escaped characters, while mimicking how POSIX shells does it, by using strings with double and single quotes. For example, with: $ cat .Renviron APPDATA='C:\Users\foobar\App

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-10-31 Thread Tomas Kalibera
On 10/31/21 2:55 AM, Henrik Bengtsson wrote: ... If one still needed backslashes, they could then be entered in single quotes, e.g. VAR='c:\users'. I don't think it matters whether you use single or double quotes - both will work. Here's a proof of concept on Linux with R 4.1.1: $ cat ./.Ren

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-10-30 Thread Henrik Bengtsson
> ... If one still needed backslashes, > they could then be entered in single quotes, e.g. VAR='c:\users'. I don't think it matters whether you use single or double quotes - both will work. Here's a proof of concept on Linux with R 4.1.1: $ cat ./.Renviron A=C:\users B='C:\users' C="C:\users" $

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-10-27 Thread Tomas Kalibera
On 10/21/21 5:18 PM, Martin Maechler wrote: Michał Bojanowski on Wed, 20 Oct 2021 16:31:08 +0200 writes: > Hello Tomas, > Yes, that's accurate although rather terse, which is perhaps the > reason why I did not realize it applies to my case. > How about adding somethin

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-10-21 Thread Martin Maechler
> Michał Bojanowski > on Wed, 20 Oct 2021 16:31:08 +0200 writes: > Hello Tomas, > Yes, that's accurate although rather terse, which is perhaps the > reason why I did not realize it applies to my case. > How about adding something in the direction of: > 1. Continu

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-10-20 Thread Henrik Bengtsson
Two comments/suggestions: 1. What about recommending to always quote the value in Renviron files, e.g. ABC="Hello world" and DEF="${APPDATA}/R-library"? This should a practice that works on all platforms. 2. What about having readRenviron() escapes strings it imports via environment variables?

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-10-20 Thread Michał Bojanowski
Hello Tomas, Yes, that's accurate although rather terse, which is perhaps the reason why I did not realize it applies to my case. How about adding something in the direction of: 1. Continuing the cited paragraph with: In particular, on Windows it may be necessary to quote references to existing

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-10-18 Thread Tomas Kalibera
On 10/15/21 6:44 PM, Michał Bojanowski wrote: Perhaps a small update to ?.Renviron would be in order to mention that... Would you have a more specific suggestion how to update the documentation? Please note that it already says "‘value’ is then processed in a similar way to a Unix shell: i

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-10-15 Thread Michał Bojanowski
Perhaps a small update to ?.Renviron would be in order to mention that... On Fri, Oct 15, 2021 at 6:43 PM Michał Bojanowski wrote: > > Indeed quoting works! Kevin suggested the same, but he didnt reply to the > list. > Thank you all! > Michal > > On Fri, Oct 15, 2021 at 6:40 PM Ivan Krylov wrot

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-10-15 Thread Michał Bojanowski
Indeed quoting works! Kevin suggested the same, but he didnt reply to the list. Thank you all! Michal On Fri, Oct 15, 2021 at 6:40 PM Ivan Krylov wrote: > > Sorry for the noise! I wasn't supposed to send my previous message. > > On Fri, 15 Oct 2021 16:44:28 +0200 > Michał Bojanowski wrote: > > >

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-10-15 Thread Ivan Krylov
Sorry for the noise! I wasn't supposed to send my previous message. On Fri, 15 Oct 2021 16:44:28 +0200 Michał Bojanowski wrote: > AVAR=${APPDATA}/foo/bar > > Which is a documented way of referring to existing environment > variables. Now, with that in R I'm getting: > > Sys.getenv("APPDATA")

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-10-15 Thread Ivan Krylov
On Fri, 15 Oct 2021 16:44:28 +0200 Michał Bojanowski wrote: > AVAR=${APPDATA}/foo/bar > > Which is a documented way of referring to existing environment > variables. Now, with that in R I'm getting: > > Sys.getenv("APPDATA")# That works OK > [1] "C:\\Users\\mbojanowski\\AppData\\Roaming" >

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-10-15 Thread Duncan Murdoch
On 15/10/2021 10:44 a.m., Michał Bojanowski wrote: Dear colleagues, I would be grateful if somebody could explain and perhaps help work around the following. I have .Renviron with, say: AVAR=${APPDATA}/foo/bar Which is a documented way of referring to existing environment variables. Now, with