{"action":"created","issue":{"url":"https://api.github.com/repos/dthree/cash/issues/44","repository_url":"https://api.github.com/repos/dthree/cash","labels_url":"https://api.github.com/repos/dthree/cash/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/dthree/cash/issues/44/comments","events_url":"https://api.github.com/repos/dthree/cash/issues/44/events","html_url":"https://github.com/dthree/cash/pull/44","id":137112937,"number":44,"title":"Adding export command","user":{"login":"nfischer","id":5801521,"avatar_url":"https://avatars.githubusercontent.com/u/5801521?v=3","gravatar_id":"","url":"https://api.github.com/users/nfischer","html_url":"https://github.com/nfischer","followers_url":"https://api.github.com/users/nfischer/followers","following_url":"https://api.github.com/users/nfischer/following{/other_user}","gists_url":"https://api.github.com/users/nfischer/gists{/gist_id}","starred_url":"https://api.github.com/users/nfischer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfischer/subscriptions","organizations_url":"https://api.github.com/users/nfischer/orgs","repos_url":"https://api.github.com/users/nfischer/repos","events_url":"https://api.github.com/users/nfischer/events{/privacy}","received_events_url":"https://api.github.com/users/nfischer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-28T23:53:31Z","updated_at":"2016-02-29T01:35:34Z","closed_at":"2016-02-29T00:19:09Z","pull_request":{"url":"https://api.github.com/repos/dthree/cash/pulls/44","html_url":"https://github.com/dthree/cash/pull/44","diff_url":"https://github.com/dthree/cash/pull/44.diff","patch_url":"https://github.com/dthree/cash/pull/44.patch"},"body":"This adds the `export` command ([man page](http://ss64.com/bash/export.html)) into the mix.\r\n\r\nSimilar to how `cash $ alias foo ls` succeeds (when it wouldn't succeed in bash), `cash $ export FOO $PATH` also succeeds in redefining `FOO` to be `$PATH`.\r\n\r\nThis exports to `process.env`, which is case insensitive on Windows (even for the new attributes I'm adding). So, on Windows, you can do things like:\r\n\r\n```Bash\r\ncash $ export FOO='hello'\r\ncash $ echo $foo\r\nhello\r\n```\r\n\r\nI don't think there's any good way to avoid this behavior, so until it's a problem, I suggest it be kept.\r\n\r\nThis doesn't replace regular assignment. In bash, you can do non-exported assignment of the form: `foo=bar`, creating a variable named foo with the value \"bar\". I couldn't figure out a way to write the syntax for regular assignment (posted issue #42 for this).\r\n\r\n@dthree do you have any suggestions for additional tests? I modeled unit tests off the ones for `alias`."},"comment":{"url":"https://api.github.com/repos/dthree/cash/issues/comments/189992106","html_url":"https://github.com/dthree/cash/pull/44#issuecomment-189992106","issue_url":"https://api.github.com/repos/dthree/cash/issues/44","id":189992106,"user":{"login":"dthree","id":10319897,"avatar_url":"https://avatars.githubusercontent.com/u/10319897?v=3","gravatar_id":"","url":"https://api.github.com/users/dthree","html_url":"https://github.com/dthree","followers_url":"https://api.github.com/users/dthree/followers","following_url":"https://api.github.com/users/dthree/following{/other_user}","gists_url":"https://api.github.com/users/dthree/gists{/gist_id}","starred_url":"https://api.github.com/users/dthree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dthree/subscriptions","organizations_url":"https://api.github.com/users/dthree/orgs","repos_url":"https://api.github.com/users/dthree/repos","events_url":"https://api.github.com/users/dthree/events{/privacy}","received_events_url":"https://api.github.com/users/dthree/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T01:35:34Z","updated_at":"2016-02-29T01:35:34Z","body":"Ah good point.\r\n\r\nhttp://stackoverflow.com/questions/496702/can-a-shell-script-set-environment-variables-of-the-calling-shell\r\n\r\nI was thinking that, if called independently, it could `export` to the current shell's environment. We'd have to find some tricky way to do that.\r\n\r\n"}}