Hi folks,
I’m trying to run a local shell command from the script console, and a
mismatched quote error is kicking my butt. The entire command is surrounded by
double quotes, and the command executed from the “-c” is surrounded by single
quotes. There’s not a typo, I swear! Any ideas? The strange this is that it
only seems to happen if there’s multiple items separated by spaces in the
single quotes. If I do a single executable like ‘ls’, that works fine.
import hudson.util.RemotingDiagnostics
import jenkins.model.Jenkins
def String target_database = "testdb"
def String version = "7.6.5.4"
def sout = new StringBuffer(), serr = new StringBuffer()
def proc = "sudo su oracle -c
'/home/oracle/scripts/datapump/refresh_database.sh ${target_database}
${version}'".execute()
proc.consumeProcessOutput(sout, serr)
proc.waitForOrKill(1000)
println "STDOUT\n $sout"
println "STDERR\n $serr"
STDOUT
STDERR
testdb: -c: line 0: unexpected EOF while looking for matching `''
testdb: -c: line 1: syntax error: unexpected end of file
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/B83C39DA-406A-460E-BF45-4AA9E7F70C56%40vonnieda.org.
For more options, visit https://groups.google.com/d/optout.