HI all,
Java NIO2 providers
(https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html)
works by providing filesystems via SPI. Ideally one would just write the
appropriate classes and drop them on the classpath . This allows
somebody does to write something like:
http://groovy-lang.org/syntax.html#all-strings
On 30.05.2018 21:38, Chris Fouts wrote:
Thanks. Here's the complete code snippet
#!/usr/bin/env groovy
String cmd = $/
IFS=" " read -ra LINE <<< `ls -al | grep Music`
echo ${LINE[4]}
/$
StringBuilder outstr = new StringBuilder()
StringBuilde
You might want to not use dollar slashy and use just slashy or ‘’’ as dollar
slashy interpolates….or …. Just escape the dollar sign in your shell script
with a \
Erick Nelson
Senior Developer – IT
HD Supply Facilities Maintenance
(858) 740-6523
From: Chris Fouts
Reply-To: "users@groovy.apache
Thanks. Here's the complete code snippet
#!/usr/bin/env groovy
String cmd = $/
IFS=" " read -ra LINE <<< `ls -al | grep Music`
echo ${LINE[4]}
/$
StringBuilder outstr = new StringBuilder()
StringBuilder errstr = new StringBuilder()
Process proc = cmd.execute()
proc.waitForProcessOutput
I mistyped
It is …
$/
/$
Similar to
'''
'''
They are known as “dollar slashy strings”
Erick Nelson
Senior Developer – IT
HD Supply Facilities Maintenance
(858) 740-6523
From: Chris Fouts
Reply-To: "users@groovy.apache.org"
Date: Wednesday, May 30, 2018 at 11:55 AM
To: "users@groovy.apache.o
Thanks. Do the /$ designate a begin/end fo the commands I want to execute?
So using my example, I do
String cmd = /$
IFS=" " read -ra LINE <<< `ls -al | grep some_file`
echo ${LINE[4]}
/$
On Wed, May 30, 2018 at 2:20 PM Nelson, Erick
wrote:
>
>
> String cmd = /$
>
> What you want to shel
String cmd = /$
What you want to shell out and execute here
Remember, java shells out as sh, not bash or your shell of choice
/$
// output and error can be any class that implements Appendable
StringBuilder output = new StringBuilder()
StringBuilder error = new StringBuilder ()
Process pro
Inside groovy, I want to write a shell script that parses the output of
some shell command and get some string value back. How can I get the value
of the shell command?
For example say I want to get the file size of some_file, I'll do
x = sh returnStatus: true, script: '''
IFS=" " read -ra LINE
Congrats on the new release and all the hard work that went into it.
--
Robert
On Wed, May 30, 2018 at 2:37 AM, Paul King wrote:
> Dear community,
>
> The Apache Groovy team is pleased to announce version 2.5.0 of Apache
> Groovy!
> Apache Groovy is a multi-facet programming language for the JV