cakephp/cakephp — pull request #3530 by beporter (2014-05-19 19:23:59+00:00)
Title: Harden the `cake` script to avoid `CDPATH` breakage.

When a user has a defined [`CDPATH`](http://www.tldp.org/LDP/abs/html/internalvariables.html#CDPATHREF) in their shell environment, bash changes the behavior of its `cd` builtin to echo the full path being changed to. This output interferes with scripts that attempt to use cd to capture values into a variable, such as the `cake` shell script. This typically manifests itself as unexpected errors like

```
$ Vendor/bin/cake
Could not open input file: ./bin
/var/www/Vendor/bin/cake.php
```

There are typically two solutions to this:

1. `unset CDPATH` at the top of every script that might run into this conflict.
1. Redirect the stdout from the `cd` commands in your script to `/dev/null`.

This PR implements the latter since in the context the `cd` command is being used, any output is safely irrelevant and in fact troublesome.