thttpd-PATH-change.txt



#	*****************************

#	If you are using Ubuntu, or the path is found in /etc/environment:

#	This took me a long time to find but I finally found where to permanently change this in Ubuntu. It is hiding in "/etc" in the file "environment", one could just add: "/home/local/sbin:/home/local/bin:" to the beginning of the line of text. I ran into a lot of new bugs in Ubuntu so have quit using it!


		frank@frank-desktop:~$ 
		frank@frank-desktop:~$ $PATH   ### 754

		bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin: No such file or directory

		frank@frank-desktop:~$ 


frank@raspberrypi:~ $ cat /etc/environment     ### 761

		frank@frank-desktop:~$ 

#	If the PATH is in /etc/environment, then use sudo nano to add the following to the beginning of the "path" (inside the quote) /home/local/sbin:/home/local/bin: so the line will begin like: "/home/local/sbin:/home/local/bin:/usr/local/sbin:/usr/local/bin:/...."

#		frank@frank-desktop:~$ 
#		frank@frank-desktop:~$ sudo nano /etc/environment     ### sudo 768
#
#	Make your changes and then "control o" to write and "control x" to exit.
#
#		frank@frank-desktop:~$ 
#		frank@frank-desktop:~$ cat /etc/environment     ### 773
#		frank@frank-desktop:~$ 
#
#	Make sure the "path" begins like: "/home/local/sbin:/home/local/bin:/usr/local/sbin:/usr/local/bin:/...."
#
#	The computer has to be restarted for the new "path" to take effect.
#
#	Make sure everything you want to save is saved and then you can:
#
#
#	*****REBOOT*****
#
#		frank@frank-desktop:~$ 
#		frank@frank-desktop:~$ sudo reboot     ### sudo 786
#
#	*****************************
#
#	When the computer comes back up, go to a terminal and enter:
#
#		frank@frank-desktop:~$ 
#		frank@frank-desktop:~$ $PATH     ### 793
#		frank@frank-desktop:~$ 
#
#	Make sure the "path" begins with: "/home/local/sbin:/home/local/bin:/usr/local/sbin:/usr/local/bin:/...."
#
#	*****************************
#
#
#	Now back on the Raspberry Pi OS.
#
pi@raspberrypi:~ $ 
pi@raspberrypi:~ $ 


frank@raspberrypi:~ $ $PATH     ### 807
bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games: No such file or directory


pi@raspberrypi:~ $ #	On the Raspberry Pi OS the built in "PATH" is stored in "/etc/profile" on two different lines. One will have to add "/home/local/sbin:/home/local/bin:" to the beginning of the quote. PATH="/usr/local/sbin:/usr/local/bin: ...", to: PATH="/home/local/sbin:/home/local/bin:/usr/local/sbin: ..." for both lines.


frank@raspberrypi:~ $ cd /etc     ### 814
frank@raspberrypi:/etc $ 


frank@raspberrypi:/etc $ cat profile     ### 818
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "$(id -u)" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"
fi
export PATH

if [ "${PS1-}" ]; then
  if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "$(id -u)" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi
frank@raspberrypi:/etc $ 


frank@raspberrypi:/etc $ sudo nano profile     ### 856
frank@raspberrypi:/etc $ 



frank@raspberrypi:/etc $ cat profile     ### 861
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "$(id -u)" -eq 0 ]; then
  PATH="/home/local/sbin:/home/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/home/local/sbin:/home/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"
fi
export PATH

if [ "${PS1-}" ]; then
  if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "$(id -u)" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi
frank@raspberrypi:/etc $ 


pi@raspberrypi:~ $ # Make sure the path is right, one will need to reboot to make it active.


frank@raspberrypi:/etc $ reboot     ### 902



frank@raspberrypi:~ $ date     ### 906
Thu 07 Jul 2022 04:10:33 PM MDT


frank@raspberrypi:~ $ $PATH     ### 910
bash: /home/local/sbin:/home/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games: No such file or directory
frank@raspberrypi:~ $ 


#	*****************************   ### 915

