#!/bin/fish # only apply profile.env for login shells, as we'd like fish to # inherit existing shell environment without overriding it if status --is-login set -lx IFS = env -i /bin/sh -c '. /etc/profile.env; /bin/env -0 -u PWD' | while read -z K V set -gx $K $V end if [ "$EUID" = "0" ]; or [ "$USER" = "root" ] set -gx PATH /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin (string replace -a -- : \n $ROOTPATH) else set -gx PATH /usr/local/bin /usr/bin /bin (string replace -a -- : \n $PATH) end set -e ROOTPATH # Re-prepend $fish_user_paths __fish_reconstruct_path end