The trick was to use a list:
println(['ls', '/tmp/folder with spaces'].execute().text)
More Related Contents:
- Split a string in groovy
- How do I get the output of a shell command executed using into a variable from Jenkinsfile (groovy)?
- Groovy executing shell commands
- Understanding the groovy syntax in a gradle task definition
- Including a groovy script in another groovy
- Creating a Jenkins environment variable using Groovy
- Can you break from a Groovy “each” closure?
- How do I create and access the global variables in Groovy?
- What the difference in applying gradle plugin
- Load script from groovy script
- Get values from properties file using Groovy
- Groovy: what’s the purpose of “def” in “def x = 0”?
- Converting a string to int in Groovy
- How can I use the Jenkins Copy Artifacts Plugin from within the pipelines (jenkinsfile)?
- Reading file from Workspace in Jenkins with Groovy script
- Groovy different results on using equals() and == on a GStringImpl
- Recommended way to stop a Gradle build
- Difference between Groovy Binary and Source release?
- How to retrieve Jenkins build parameters using the Groovy API?
- Generate A Weighted Random Number
- Using Javamail to connect to Gmail smtp server ignores specified port and tries to use 25
- Jenkins Pipeline NotSerializableException: groovy.json.internal.LazyMap
- Gson Serialize field only if not null or not empty
- How to read a properties files and use the values in project Gradle script?
- How do I auto load a database jar in Groovy without using the -cp switch?
- How do I simply parse a date without a year specified?
- How do I create an XPath function in Groovy
- Closures in Groovy not capturing outside variables
- How to list all `env` properties within jenkins pipeline job?
- What’s wrong with Groovy multi-line String?