MCPcopy Index your code
hub / github.com/devcontainers/cli / getEntPasswdShellCommand

Function getEntPasswdShellCommand

src/spec-common/commonUtils.ts:592–598  ·  view source on GitHub ↗
(userNameOrId: string)

Source from the content-addressed store, hash-verified

590}
591
592export function getEntPasswdShellCommand(userNameOrId: string) {
593 const escapedForShell = userNameOrId.replace(/['\\]/g, '\\$&');
594 const escapedForRexExp = escapeRegExCharacters(userNameOrId)
595 .replaceAll('\'', '\\\'');
596 // Leading space makes sure we don't concatenate to arithmetic expansion (https://tldp.org/LDP/abs/html/dblparens.html).
597 return ` (command -v getent >/dev/null 2>&1 && getent passwd '${escapedForShell}' || grep -E '^${escapedForRexExp}|^[^:]*:[^:]*:${escapedForRexExp}:' /etc/passwd || true)`;
598}

Callers 3

getUserFromPasswdDBFunction · 0.90
getFeatureLayersFunction · 0.90

Calls 1

escapeRegExCharactersFunction · 0.90

Tested by

no test coverage detected