{"action":"created","issue":{"url":"https://api.github.com/repos/fish-shell/fish-shell/issues/2391","labels_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/2391/labels{/name}","comments_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/2391/comments","events_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/2391/events","html_url":"https://github.com/fish-shell/fish-shell/issues/2391","id":106669601,"number":2391,"title":"environment is not available when sourcing /etc/fish/config.fish","user":{"login":"Profpatsch","id":3153638,"avatar_url":"https://avatars.githubusercontent.com/u/3153638?v=3","gravatar_id":"","url":"https://api.github.com/users/Profpatsch","html_url":"https://github.com/Profpatsch","followers_url":"https://api.github.com/users/Profpatsch/followers","following_url":"https://api.github.com/users/Profpatsch/following{/other_user}","gists_url":"https://api.github.com/users/Profpatsch/gists{/gist_id}","starred_url":"https://api.github.com/users/Profpatsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Profpatsch/subscriptions","organizations_url":"https://api.github.com/users/Profpatsch/orgs","repos_url":"https://api.github.com/users/Profpatsch/repos","events_url":"https://api.github.com/users/Profpatsch/events{/privacy}","received_events_url":"https://api.github.com/users/Profpatsch/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-15T23:40:17Z","updated_at":"2015-09-16T00:38:30Z","closed_at":"2015-09-15T23:49:04Z","body":"My problem: I’m trying to source files in an env variable.\r\n\r\nFor that I append the following to my `/etc/fish/config.fish`\r\n\r\n```fish\r\n    echo DEBUG\r\n    env\r\n    echo DEBUG2\r\n    for p in $FISH_SOURCE_PATHS\r\n      echo \"sourced $p\"\r\n      source \"$p\"\r\n    end\r\n```\r\n\r\na file foo `echo \"echo foo\" > ~/foo\r\n\r\nand call\r\n\r\n```fish\r\n~> env -i FISH_SOURCE_PATHS=/home/philip/foo fish\r\nDEBUG\r\nFISH_SOURCE_PATHS=/home/philip/foo\r\nHOME=/home/philip\r\nPATH=/usr/bin:/bin\r\nPWD=/home/philip/nixpkgs\r\nSHLVL=1\r\nUSER=philip\r\n__fish_bin_dir=/nix/store/aq5yv3i6ln4w84y2ais5m2j5a6z0djsz-fish-2.2.0/bin\r\n__fish_datadir=/nix/store/aq5yv3i6ln4w84y2ais5m2j5a6z0djsz-fish-2.2.0/share/fish\r\n__fish_help_dir=/nix/store/aq5yv3i6ln4w84y2ais5m2j5a6z0djsz-fish-2.2.0/share/doc/fish\r\n__fish_sysconfdir=/nix/store/aq5yv3i6ln4w84y2ais5m2j5a6z0djsz-fish-2.2.0/etc/fish\r\nDEBUG2\r\n```\r\n\r\nIt should print `foo` after `DEBUG2`.\r\n\r\nEven a simpler command like `for p in $EXISTINGVAR; echo \"$p\"; end` does not print anything.\r\nInterestingly, for `$PWD` this prints an empty line."},"comment":{"url":"https://api.github.com/repos/fish-shell/fish-shell/issues/comments/140588088","html_url":"https://github.com/fish-shell/fish-shell/issues/2391#issuecomment-140588088","issue_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/2391","id":140588088,"user":{"login":"ridiculousfish","id":920838,"avatar_url":"https://avatars.githubusercontent.com/u/920838?v=3","gravatar_id":"","url":"https://api.github.com/users/ridiculousfish","html_url":"https://github.com/ridiculousfish","followers_url":"https://api.github.com/users/ridiculousfish/followers","following_url":"https://api.github.com/users/ridiculousfish/following{/other_user}","gists_url":"https://api.github.com/users/ridiculousfish/gists{/gist_id}","starred_url":"https://api.github.com/users/ridiculousfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ridiculousfish/subscriptions","organizations_url":"https://api.github.com/users/ridiculousfish/orgs","repos_url":"https://api.github.com/users/ridiculousfish/repos","events_url":"https://api.github.com/users/ridiculousfish/events{/privacy}","received_events_url":"https://api.github.com/users/ridiculousfish/received_events","type":"User","site_admin":false},"created_at":"2015-09-16T00:38:30Z","updated_at":"2015-09-16T00:38:30Z","body":"Ah-ha!"}}