jpetazzo/nsenter — pull request #43 by kolypto (2014-10-08 22:19:13+00:00)
Title: Preserve the container's root process environment

Fixes #18, when entering a container, the environment is preserved:

```console
kolypto@localhost% ./docker-enter myapp env | fgrep DB_1_PORT_5432_TCP_ADDR
DB_1_PORT_5432_TCP_ADDR=172.17.0.63
```

It also works as a login shell, without the command:

```console
kolypto@localhost% docker-enter myapp
root@b6b93bc18ec2:/# env | fgrep DB_1_PORT_5432_TCP_ADDR
DB_1_PORT_5432_TCP_ADDR=172.17.0.63
```

(that means, `bash` is not hardcoded).

Also did a bit of refactoring on the code, but nothing serious:

* Replaced `if [ ... ] ; then .. fi` with `[ ... ] && ...`
* Put `$1` into `$COMMAND`
* Refactored `if [ -z "$1" ]; then` into setting a default value for `$COMMAND`

@jpetazzo , what do you think?