{"action":"created","issue":{"url":"https://api.github.com/repos/rbenv/rbenv/issues/898","repository_url":"https://api.github.com/repos/rbenv/rbenv","labels_url":"https://api.github.com/repos/rbenv/rbenv/issues/898/labels{/name}","comments_url":"https://api.github.com/repos/rbenv/rbenv/issues/898/comments","events_url":"https://api.github.com/repos/rbenv/rbenv/issues/898/events","html_url":"https://github.com/rbenv/rbenv/pull/898","id":150227627,"number":898,"title":"silence stdout when cding to working directory","user":{"login":"mikelikesbikes","id":54649,"avatar_url":"https://avatars.githubusercontent.com/u/54649?v=3","gravatar_id":"","url":"https://api.github.com/users/mikelikesbikes","html_url":"https://github.com/mikelikesbikes","followers_url":"https://api.github.com/users/mikelikesbikes/followers","following_url":"https://api.github.com/users/mikelikesbikes/following{/other_user}","gists_url":"https://api.github.com/users/mikelikesbikes/gists{/gist_id}","starred_url":"https://api.github.com/users/mikelikesbikes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikelikesbikes/subscriptions","organizations_url":"https://api.github.com/users/mikelikesbikes/orgs","repos_url":"https://api.github.com/users/mikelikesbikes/repos","events_url":"https://api.github.com/users/mikelikesbikes/events{/privacy}","received_events_url":"https://api.github.com/users/mikelikesbikes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-04-22T00:29:34Z","updated_at":"2016-04-22T15:14:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rbenv/rbenv/pulls/898","html_url":"https://github.com/rbenv/rbenv/pull/898","diff_url":"https://github.com/rbenv/rbenv/pull/898.diff","patch_url":"https://github.com/rbenv/rbenv/pull/898.patch"},"body":"I noticed an issue where the working directory was bring printed to STDOUT when running a script from outside the directory.\r\n\r\nHere's more detail.\r\n\r\nGiven this project structure:\r\n\r\n```\r\n.\r\n└── bin\r\n    └── rubyscript\r\n```\r\n\r\nand the file `bin/rubyprogram` contains:\r\n\r\n```ruby\r\n#!/usr/bin/env ruby\r\nputs \"hi\"\r\n```\r\n\r\nI see this in the console when I run the program from outside, then inside the `bin` directory.\r\n\r\n```\r\n$ bin/rubyprogram\r\n/Users/mike/projects/ruby-script/bin\r\nhi\r\n$ cd ./bin\r\n$ ./rubyprogram\r\nhi\r\n```\r\n\r\nThis PR fixes the issue."},"comment":{"url":"https://api.github.com/repos/rbenv/rbenv/issues/comments/213468564","html_url":"https://github.com/rbenv/rbenv/pull/898#issuecomment-213468564","issue_url":"https://api.github.com/repos/rbenv/rbenv/issues/898","id":213468564,"user":{"login":"mikelikesbikes","id":54649,"avatar_url":"https://avatars.githubusercontent.com/u/54649?v=3","gravatar_id":"","url":"https://api.github.com/users/mikelikesbikes","html_url":"https://github.com/mikelikesbikes","followers_url":"https://api.github.com/users/mikelikesbikes/followers","following_url":"https://api.github.com/users/mikelikesbikes/following{/other_user}","gists_url":"https://api.github.com/users/mikelikesbikes/gists{/gist_id}","starred_url":"https://api.github.com/users/mikelikesbikes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikelikesbikes/subscriptions","organizations_url":"https://api.github.com/users/mikelikesbikes/orgs","repos_url":"https://api.github.com/users/mikelikesbikes/repos","events_url":"https://api.github.com/users/mikelikesbikes/events{/privacy}","received_events_url":"https://api.github.com/users/mikelikesbikes/received_events","type":"User","site_admin":false},"created_at":"2016-04-22T15:14:36Z","updated_at":"2016-04-22T15:14:36Z","body":"Another option, my actual favorite:\r\n\r\n```\r\n#!/usr/bin/env bash\r\nset -e\r\nunset CDPATH\r\n```"}}