{"action":"created","issue":{"url":"https://api.github.com/repos/koalaman/shellcheck/issues/473","labels_url":"https://api.github.com/repos/koalaman/shellcheck/issues/473/labels{/name}","comments_url":"https://api.github.com/repos/koalaman/shellcheck/issues/473/comments","events_url":"https://api.github.com/repos/koalaman/shellcheck/issues/473/events","html_url":"https://github.com/koalaman/shellcheck/issues/473","id":108150457,"number":473,"title":"SC2094 / false positive?","user":{"login":"helpermethod","id":1562019,"avatar_url":"https://avatars.githubusercontent.com/u/1562019?v=3","gravatar_id":"","url":"https://api.github.com/users/helpermethod","html_url":"https://github.com/helpermethod","followers_url":"https://api.github.com/users/helpermethod/followers","following_url":"https://api.github.com/users/helpermethod/following{/other_user}","gists_url":"https://api.github.com/users/helpermethod/gists{/gist_id}","starred_url":"https://api.github.com/users/helpermethod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helpermethod/subscriptions","organizations_url":"https://api.github.com/users/helpermethod/orgs","repos_url":"https://api.github.com/users/helpermethod/repos","events_url":"https://api.github.com/users/helpermethod/events{/privacy}","received_events_url":"https://api.github.com/users/helpermethod/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-24T15:08:51Z","updated_at":"2015-09-25T07:11:16Z","closed_at":"2015-09-25T07:11:16Z","body":"Hi,\r\n\r\nShellCheck complains about the implementation of my __inc function:\r\n\r\n    __inc() {\r\n      printf '%d' $(($(< \"$1\") + 1)) > \"$1\"\r\n    }\r\n\r\nAs far as I understand, there is no race condition here as the read / write don't occur within the same pipe.\r\n\r\nI would guess the `$(< \"$1\")` would first read in the value as a whole, right?"},"comment":{"url":"https://api.github.com/repos/koalaman/shellcheck/issues/comments/143146661","html_url":"https://github.com/koalaman/shellcheck/issues/473#issuecomment-143146661","issue_url":"https://api.github.com/repos/koalaman/shellcheck/issues/473","id":143146661,"user":{"login":"helpermethod","id":1562019,"avatar_url":"https://avatars.githubusercontent.com/u/1562019?v=3","gravatar_id":"","url":"https://api.github.com/users/helpermethod","html_url":"https://github.com/helpermethod","followers_url":"https://api.github.com/users/helpermethod/followers","following_url":"https://api.github.com/users/helpermethod/following{/other_user}","gists_url":"https://api.github.com/users/helpermethod/gists{/gist_id}","starred_url":"https://api.github.com/users/helpermethod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helpermethod/subscriptions","organizations_url":"https://api.github.com/users/helpermethod/orgs","repos_url":"https://api.github.com/users/helpermethod/repos","events_url":"https://api.github.com/users/helpermethod/events{/privacy}","received_events_url":"https://api.github.com/users/helpermethod/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T07:11:16Z","updated_at":"2015-09-25T07:11:16Z","body":"So I guess it will just write the output to a temporary file and then just mv it as suggested. Thanks for your answers!"}}