enter.sh: Split env vars by NULL byte instead of whitespace

This commit is contained in:
Petros Angelatos 2015-08-02 20:35:49 +01:00 committed by Pablo Carranza Vélez
parent 0703759782
commit fecf906ce5

View File

@ -10,5 +10,5 @@ CONTAINER_PID=$($ENGINE inspect --format '{{if .State.Running}}{{.State.Pid}}{{e
if [ -z $CONTAINER_PID ]; then
read -p "Application must be running for a terminal to be started."
else
nsenter --target $CONTAINER_PID --mount --uts --ipc --net --pid -- bash -c 'export $(xargs -n 1 -0 < /proc/1/environ); exec bash'
nsenter --target $CONTAINER_PID --mount --uts --ipc --net --pid -- bash -c 'while IFS= read -r -d "" var; do export "$var"; done < /proc/1/environ; exec bash'
fi