Gabriel Feo
02/19/2020, 9:27 AMExec
task’s command? Escaping the dollar sign doesn’t seem to work. For example:
commandLine = listOf("echo", "Declared in env GOOGLE_APPLICATION_CREDENTIALS=\$GOOGLE_APPLICATION_CREDENTIALS")
Output:
Declared in env GOOGLE_APPLICATION_CREDENTIALS=$GOOGLE_APPLICATION_CREDENTIALS
octylFractal
02/19/2020, 9:29 AM-c
, rather than using exec directlylistOf("bash", "-c", "echo 'Declared in env ...')
Fleshgrinder
02/19/2020, 9:31 AM'echo' 'Declared in env GOOGLE_APPLICATION_CREDENTIALS=$GOOGLE_APPLICATION_CREDENTIALS'
and nothing gets interpreted. Do what @octylFractal said or use System.getenv
.octylFractal
02/19/2020, 9:32 AMexecve
& friends -- that means that it's not using any bash builtins such as echo
or cd
Fleshgrinder
02/19/2020, 9:37 AMoctylFractal
02/19/2020, 9:40 AM/usr/bin/echo
can behave differently, but don't in most cases 😛Fleshgrinder
02/19/2020, 9:45 AMGabriel Feo
02/19/2020, 1:50 PM