code: def unix_install():
      
      PmagPyDir = os.path.abspath(".")
      COMMAND = """\n
  for d in %s/programs/*/ "%s/programs/"; do
    case ":$PATH:" in
      *":$d:"*) :;; # already there
      *) PMAGPATHS="$PMAGPATHS:$d";; # or PATH="$PATH:$new_entry"
    esac
  done
  export PYTHONPATH="$PYTHONPATH:%s:%s/programs/"
  export PATH="$PATH:$PMAGPATHS" """ % (PmagPyDir, PmagPyDir, PmagPyDir, PmagPyDir)
      frc_path = os.path.join(
          os.environ["HOME"], ".bashrc")  # not recommended, but hey it freaking works
      fbprof_path = os.path.join(os.environ["HOME"], ".bash_profile")
      fprof_path = os.path.join(os.environ["HOME"], ".profile")
      all_paths = [frc_path, fbprof_path, fprof_path]
  
      for f_path in all_paths:
          open_type = 'a'
          if not os.path.isfile(f_path):
              open_type = 'w+'
              fout = open(f_path, open_type)
              fout.write(COMMAND)
              fout.close()
          else:
              fin = open(f_path, 'r')
              current_f = fin.read()
              fin.close()
              if COMMAND not in current_f:
                  fout = open(f_path, open_type)
                  fout.write(COMMAND)
                  fout.close()
  
      print("Install complete. Please restart the shell to complete install.\nIf you are seeing strange or non-existent paths in your PATH or PYTHONPATH variable please manually check your .bashrc, .bash_profile, and .profile or attempt to reinstall.")
docs: Edits or creates .bashrc, .bash_profile, and .profile files in the users
      HOME directory in order to add your current directory (hopefully your
      PmagPy directory) and assorted lower directories in the PmagPy/programs
      directory to your PATH environment variable. It also adds the PmagPy and
      the PmagPy/programs directories to PYTHONPATH.