Reduce number of subshells generated
This commit is contained in:
parent
4c0cab2572
commit
e5ba8b722e
|
@ -131,5 +131,10 @@ export function privilegedTeardown({ uid, uuid }: Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function bash(cmdline: string) {
|
export function bash(cmdline: string) {
|
||||||
|
if (!cmdline.match(/[;|&(){}=]/)) {
|
||||||
|
// Reduce number of subshells we generate, if we're just running a
|
||||||
|
// single command (no shell logic).
|
||||||
|
cmdline = "exec " + cmdline;
|
||||||
|
}
|
||||||
return ["bash", "-c", cmdline];
|
return ["bash", "-c", cmdline];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue