Bash command is not executed

i’m trying to execute below command using golang on Core OS

/bin/xargs -0 bash -c ‘printf “%q\n” “$@”’ – < /proc/3194/environ

its fail with failed with exit status 127\n msg=“bash: printf “%!q(MISSING)\n” “$@”: command not found\n”

subcmd := fmt.Sprintf("%s %s", "'printf \"%%q\\n\" \"$@\"' -- < ", file)

cmd := exec.Command("xargs", "-0", "bash", "-c", subcmd)

out, err := cmd.CombinedOutput()

What is the equivalent command on a shell that works?

/bin/xargs -0 bash -c ‘printf “%q\n” “$@”’ – < /proc/3194/environ

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.