I added a line echo $PATH > /home/z/path.txt to the front of /etc/profile and found the content of /home/z/path.txt was as follows:
/usr/local/bin:/usr/local/sbin:/usr/bin
Part of the modified /etc/profile:
# /etc/profile
# Set our umask
umask 022
echo $PATH > /home/z/path.txt
# Append "$1" to $PATH when not already in.
# This function API is accessible to scripts in /etc/profile.d
append_path () {
case ":$PATH:" in
*:"$1":*)
;;
*)
PATH="${PATH:+$PATH:}$1"
esac
}
# Append our default paths
append_path '/usr/bin'
append_path '/usr/local/sbin'
append_path '/usr/local/bin'
As you can see the PATH is not empty when /etc/profile is processed. My question is: before /etc/profile is processed, what script sets the PATH variable?
I've looked through /etc/environment but I don't think it's the one I am looking for:
#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
QT_AUTO_SCREEN_SCALE_FACTOR=1
QT_QPA_PLATFORMTHEME="gnome"
QT_STYLE_OVERRIDE="kvantum"
# Force to use Xwayland backend
# QT_QPA_PLATFORM=xcb
#Not tested: this should disable window decorations
# QT_WAYLAND_DISABLE_WINDOWDECORATION=1
EDITOR=/usr/bin/nano
I am using zsh shell on manjaro.