Skip to content

Instantly share code, notes, and snippets.

@clementi
Last active June 26, 2018 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clementi/c0ccb307ccbcb1ca8c3aaaf1bfe02346 to your computer and use it in GitHub Desktop.
Save clementi/c0ccb307ccbcb1ca8c3aaaf1bfe02346 to your computer and use it in GitHub Desktop.
List the contents of the PATH environment variable
module main;
import std.stdio;
import std.algorithm.iteration : each, splitter;
import std.path : pathSeparator;
import std.process : environment;
int main(string[] args) {
environment.get("PATH")
.splitter(pathSeparator)
.each!(writefln);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment