{"action":"created","issue":{"url":"https://api.github.com/repos/koalaman/shellcheck/issues/380","labels_url":"https://api.github.com/repos/koalaman/shellcheck/issues/380/labels{/name}","comments_url":"https://api.github.com/repos/koalaman/shellcheck/issues/380/comments","events_url":"https://api.github.com/repos/koalaman/shellcheck/issues/380/events","html_url":"https://github.com/koalaman/shellcheck/issues/380","id":78507728,"number":380,"title":"Sometimes too overzealous in regards to unquoted variables","user":{"login":"FransUrbo","id":572706,"avatar_url":"https://avatars.githubusercontent.com/u/572706?v=3","gravatar_id":"","url":"https://api.github.com/users/FransUrbo","html_url":"https://github.com/FransUrbo","followers_url":"https://api.github.com/users/FransUrbo/followers","following_url":"https://api.github.com/users/FransUrbo/following{/other_user}","gists_url":"https://api.github.com/users/FransUrbo/gists{/gist_id}","starred_url":"https://api.github.com/users/FransUrbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FransUrbo/subscriptions","organizations_url":"https://api.github.com/users/FransUrbo/orgs","repos_url":"https://api.github.com/users/FransUrbo/repos","events_url":"https://api.github.com/users/FransUrbo/events{/privacy}","received_events_url":"https://api.github.com/users/FransUrbo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-05-20T12:36:59Z","updated_at":"2015-05-20T14:46:56Z","closed_at":null,"body":"I have the code:\r\n\r\n```\r\n        # Unset all FSTAB_* variables\r\n        unset $(env | grep ^FSTAB_ | sed 's,=.*,,')\r\n```\r\n\r\nHere, I _want_ word splitting, but <code>shellcheck</code> is complaining (giving me a warning) about this.\r\n\r\nAlso the following code is on purpose:\r\n\r\n```\r\n#!/bin/sh                                                                                                                                                     \r\n\r\nmy_function() {\r\n    local CMD=\"$1\"; shift\r\n    local ARGS=\"$*\"\r\n\r\n    \"$CMD\" $ARGS\r\n}\r\n\r\nARGS=\"-C -F -l -a\"\r\nmy_function /bin/ls \"$ARGS\"\r\n```\r\n\r\nGives <code>/tmp/tst.sh:7:12: note: Double quote to prevent globbing and word splitting. [SC2086]</code>.\r\n\r\nHowever, if I put double quotes around <code>$ARGS</code> in the function (to silence <code>shellcheck</code>:\r\n\r\n```\r\n# /tmp/tst.sh \r\n/bin/ls: invalid option -- ' '\r\nTry '/bin/ls --help' for more information.\r\n```\r\n\r\nThis time only <code>note</code>, but it's still wrong. This because it interprets the <code>-C -F -l -a</code> part as ONE command, not FOUR."},"comment":{"url":"https://api.github.com/repos/koalaman/shellcheck/issues/comments/103912314","html_url":"https://github.com/koalaman/shellcheck/issues/380#issuecomment-103912314","issue_url":"https://api.github.com/repos/koalaman/shellcheck/issues/380","id":103912314,"user":{"login":"FransUrbo","id":572706,"avatar_url":"https://avatars.githubusercontent.com/u/572706?v=3","gravatar_id":"","url":"https://api.github.com/users/FransUrbo","html_url":"https://github.com/FransUrbo","followers_url":"https://api.github.com/users/FransUrbo/followers","following_url":"https://api.github.com/users/FransUrbo/following{/other_user}","gists_url":"https://api.github.com/users/FransUrbo/gists{/gist_id}","starred_url":"https://api.github.com/users/FransUrbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FransUrbo/subscriptions","organizations_url":"https://api.github.com/users/FransUrbo/orgs","repos_url":"https://api.github.com/users/FransUrbo/repos","events_url":"https://api.github.com/users/FransUrbo/events{/privacy}","received_events_url":"https://api.github.com/users/FransUrbo/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T14:46:56Z","updated_at":"2015-05-20T14:46:56Z","body":"@izabera That might work in this simple example, but I have a couple of _real_ code where it's required to do it this way. I really don't want one separate variable for each of the options. It's a pain to maintain and extend..."}}