Skip to main content
added 9 characters in body; edited title
Source Link
muru
  • 78.3k
  • 16
  • 214
  • 320

How to reliabledo I reliably convert /proc/pid/environ to argumentarguments for the env command?

How todo I reliable convert /proc/pid/environ to argument for the env command? IFS=$'\n' ; env -i $(xargs -0n1 -a /proc/$$/environ)only working when all environment variables is exlcuded the $'\n' character. IFS=$'\0'is not working in bash and dash. Is

  • IFS=$'\n' ; env -i $(xargs -0n1 -a /proc/$$/environ) only works when all environment variables do not have the newline character.
  • IFS=$'\0'is not working in bash and dash.

Is there any other available way ?(included any other shell way)?

How to reliable convert /proc/pid/environ to argument for the env command?

How to reliable convert /proc/pid/environ to argument for the env command? IFS=$'\n' ; env -i $(xargs -0n1 -a /proc/$$/environ)only working when all environment variables is exlcuded the $'\n' character. IFS=$'\0'is not working in bash and dash. Is there any other available way ?(included any other shell way)

How do I reliably convert /proc/pid/environ to arguments for the env command?

How do I reliable convert /proc/pid/environ to argument for the env command?

  • IFS=$'\n' ; env -i $(xargs -0n1 -a /proc/$$/environ) only works when all environment variables do not have the newline character.
  • IFS=$'\0'is not working in bash and dash.

Is there any other available way (included any other shell way)?

Source Link
illiterate
  • 1k
  • 9
  • 26

How to reliable convert /proc/pid/environ to argument for the env command?

How to reliable convert /proc/pid/environ to argument for the env command? IFS=$'\n' ; env -i $(xargs -0n1 -a /proc/$$/environ)only working when all environment variables is exlcuded the $'\n' character. IFS=$'\0'is not working in bash and dash. Is there any other available way ?(included any other shell way)