So I am trying to first write the output of a shell script command into a temporary file and then trying to read it and print the output. ( I'm doing this because I'm working with a very old Jenkins version and it has old/missing plug-ins)
Here is what Im doing-->
def BRANCH_REV = sh(returnStatus: true, script: " svn info \$url | grep 'Last Changed Rev' | awk '{ print \$4; }' > output.txt")
def output = readFile('output.txt').trim()
def lines = output.readLines()
But I keep getting following error-->
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods readLines java.lang.String
Please help any suggestions are highly appreciated