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 to the program 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.