I'm surprised to encounter someone who uses a D compiler but doesn't know much about environment variables or unix shells.
Due to the nonexistent documentation for the issue,
Are you familiar with the man
command, for reading the system's manual pages? When you get some time, you might want to run man bash
and read whatever sections are relevant to things you want to do, such as where the Invocation section talks about startup files.
I’ll give my paths a more generic names in the future, so I can just rename a folder, then use the compiler right out of the box without having to mess around with the path yet again.
Creating a symlink (symbolic link) with a generic name to point at the version-specific directory name is a common way to do this. (For example, ln -s dmd-2.107.1 dmd
) You could then add the symlink's path to your PATH environment variable, and replace the symlink whenever you want to point it at a different compiler version. Run man ln
for more info.
I also suggest finding a beginner's guide to linux (or unix) when you get a chance. This stuff gets a lot easier once you learn the basics.