0

I'm trying to launch my R script via ubuntu bash with:

shell(paste ('bash -c', shQuote(my command string))

My command string contains two different path in R format: E:\\path\\path to\\path, this path must be compatible with bash path format: /mnt/e/path/path to/path. But bash refuse this, removing spaces from path.

What's the easiest way to solve this problem?

Ste40
  • 11
  • 2
  • welcome! can you explain why/how the path "must be compatible with the bash path format"? my first thought would be to use R's `file.path()` function to assemble the path in the R command string, but this might not be appropriate for your case? – mac Feb 19 '21 at 14:00
  • I'll try to explain better: i need to run my command string via bash, my command string contains two different path, one for my jar file and one for input files. Actually, to do this task i pass this string to cmd; `bash -c` allows execution via bash (i'm working on WSL). So i need that my path must be identified by bash – Ste40 Feb 19 '21 at 14:24
  • Would this work for you? `gsub('\\\\', '/', yourpath)` – gniourf_gniourf Feb 19 '21 at 14:46
  • Are you looking for [this](https://stackoverflow.com/a/12902280/8245406)? – Rui Barradas Feb 19 '21 at 14:49
  • it seems folks are still having a hard time understanding the problem. Perhaps adding some additional detail to your example would help. could you provide an example of `my command string` containing these two paths? – mac Feb 24 '21 at 18:20

0 Answers0