You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is one of those niggling areas where nested string values get a bit problematic, partly because Groovy's evaluation of backslashes in strings differs a little bit to Bash. The problem is that Groovy intercepts the backslash and if escaped character is a 'legal' character for escaping in Groovy then it throws the error. I've been thinking about ways to deal with this or at least make it clearer to people, but it's not easy to do in a clean way.
A workaround is to use yet another kind of String syntax in Groovy, using $/ and /$ as string delimiters. Then your expression becomes:
exec($/perl -p -e 's/./_/g;' $input > $output/$)
Notice that you also end up needing brackets around the value which is unfortunate.
From [email protected] on 2012-08-14T15:16:03Z
With single quotes:
$ bpipe run batch_merge_replicates.groovy ./otus/ggsilva/otu_table_ggsilva.qiime
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
script_from_command_line: 65: unexpected char: '' @ line 65, column 24.
exec "perl -p -e 's/./_/g;' $input > $output"
^
1 error
With triple quotes:
$ bpipe run batch_merge_replicates.groovy ./otus/ggsilva/otu_table_ggsilva.qiime
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
script_from_command_line: 66: unexpected char: '' @ line 66, column 21.
perl -p -e 's/./_/g;' $input > $output
1 error
Not all commands with a backslash fail. For example, this works ok:
exec """perl -p -e 'print "Foo\n";' $input > $output"""
Original issue: http://code.google.com/p/bpipe/issues/detail?id=55
The text was updated successfully, but these errors were encountered: