filebot/website/scripts/escape.groovy

8 lines
243 B
Groovy
Raw Normal View History

net.sourceforge.filebot.cli.CLILogging.CLILogger.setLevel(java.util.logging.Level.OFF)
console.printf('Enter: ')
def s = console.readLine()
// $, `, or \
console.printf('%n"' + s.replaceAll('["$`\\\\]', {'\\'+it}) + '"%n')