{"action":"created","issue":{"url":"https://api.github.com/repos/aureliojargas/clitest/issues/17","repository_url":"https://api.github.com/repos/aureliojargas/clitest","labels_url":"https://api.github.com/repos/aureliojargas/clitest/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/aureliojargas/clitest/issues/17/comments","events_url":"https://api.github.com/repos/aureliojargas/clitest/issues/17/events","html_url":"https://github.com/aureliojargas/clitest/issues/17","id":141121500,"number":17,"title":"Busybox's grep return 1 on error","user":{"login":"aureliojargas","id":282592,"avatar_url":"https://avatars.githubusercontent.com/u/282592?v=3","gravatar_id":"","url":"https://api.github.com/users/aureliojargas","html_url":"https://github.com/aureliojargas","followers_url":"https://api.github.com/users/aureliojargas/followers","following_url":"https://api.github.com/users/aureliojargas/following{/other_user}","gists_url":"https://api.github.com/users/aureliojargas/gists{/gist_id}","starred_url":"https://api.github.com/users/aureliojargas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aureliojargas/subscriptions","organizations_url":"https://api.github.com/users/aureliojargas/orgs","repos_url":"https://api.github.com/users/aureliojargas/repos","events_url":"https://api.github.com/users/aureliojargas/events{/privacy}","received_events_url":"https://api.github.com/users/aureliojargas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-03-15T22:53:14Z","updated_at":"2016-11-01T19:45:34Z","closed_at":null,"body":"Usually, grep returns 1 when the pattern not matched and 2 (or greater) when an error occurred. [See the POSIX spec about it](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html).\r\n\r\n``` console\r\n$ grep root /etc/passwd >/dev/null 2>&1; echo $?   # ok\r\n0\r\n$ grep XXXX /etc/passwd >/dev/null 2>&1; echo $?   # not found\r\n1\r\n$ grep '\\(' /etc/passwd >/dev/null 2>&1; echo $?   # error\r\n2\r\n$\r\n```\r\n\r\nClitest uses this pattern to distinguish when the `--egrep` test failed or when the user inserted an invalid pattern.\r\n\r\nUnfortunately, Busybox's grep returns 1 for errors, instead of 2, breaking this checking.\r\n\r\nThere's nothing clitest can do about it. I have opened [a bug report in Busybox](https://bugs.busybox.net/show_bug.cgi?id=8796) and I hope they can fix it.\r\n"},"comment":{"url":"https://api.github.com/repos/aureliojargas/clitest/issues/comments/257673474","html_url":"https://github.com/aureliojargas/clitest/issues/17#issuecomment-257673474","issue_url":"https://api.github.com/repos/aureliojargas/clitest/issues/17","id":257673474,"user":{"login":"aureliojargas","id":282592,"avatar_url":"https://avatars.githubusercontent.com/u/282592?v=3","gravatar_id":"","url":"https://api.github.com/users/aureliojargas","html_url":"https://github.com/aureliojargas","followers_url":"https://api.github.com/users/aureliojargas/followers","following_url":"https://api.github.com/users/aureliojargas/following{/other_user}","gists_url":"https://api.github.com/users/aureliojargas/gists{/gist_id}","starred_url":"https://api.github.com/users/aureliojargas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aureliojargas/subscriptions","organizations_url":"https://api.github.com/users/aureliojargas/orgs","repos_url":"https://api.github.com/users/aureliojargas/repos","events_url":"https://api.github.com/users/aureliojargas/events{/privacy}","received_events_url":"https://api.github.com/users/aureliojargas/received_events","type":"User","site_admin":false},"created_at":"2016-11-01T19:45:34Z","updated_at":"2016-11-01T19:45:34Z","body":"Fixed in busybox 1.25.0 → https://github.com/mirror/busybox/commit/73dfdda92e20da718a9cb398ed762cc09c82e3a7\r\n\r\nCurrently available in the `edge` version for the [Alpine Linux Docker image](https://hub.docker.com/r/library/alpine/tags/). Will probably be in future v3.5. "}}
{"actor":{"display_login":"aureliojargas"}}