setup()
Backup files are made carefully, and if a mangled initialization file is detected, it will not be modified. The lines added are bracketed by comment lines containing the phrases Macaulay 2 start and Macaulay 2 end.
The initialization files will contain added commands that add the appropriate directory to the front of the environment variable PATH so the program M2 can be found, unless that directory already occurs in the path, in which case it does not check whether that directory is the first one on the path containing a program whose name is M2, for fear of escalating a competition with another init file. (The expert user may prefer to remove those commands and instead, to create a symbolic link from a directory already on their path, such as ~/bin or ~/.bin to M2.)
The other environment variables affected are MANPATH, INFOPATH, and LD_LIBRARY_PATH.
This function is intended to be run only by users, not by system administrators, nor on behalf of users by system administrators, because system administrators can easily install Macaulay2 in such a way that the files can all be found.
Warning: there is at least one important situation where you will not want to run the Macaulay2 setup() command. For example, suppose you have installed M2, not in its own private location as described above, but in a directory with many other executable files. Suppose also that your account is adapted so it will run programs correctly on hardware of more than one architecture, or on differing operating systems, or even on various releases of the same operating system. Then setup() will modify your command shell init files so the directory containing M2 will be the first one searched when looking for a program. If you then try to use your account on different hardware, incorrect programs may be found, namely, those in the same directory as M2. Similarly, incorrect shareable libraries may also be found.
The object setup is a method function.
The source of this document is in Macaulay2Doc/functions/setup-doc.m2:68:0.