Reputation: 302
I want to use PHP with "php" command which brew had installed but fail.
I try to set environment by myself
# in bash I tried these
PATH=${PATH}:/home/linuxbrew/.linuxbrew/bin/
export PATH=${PATH}:/home/linuxbrew/.linuxbrew/bin/
# in fish bash I tried these
set PATH $PATH /home/linuxbrew/.linuxbrew/bin/ <-update: updated
export PATH $PATH:/home/linuxbrew/.linuxbrew/bin/ <-update: wrong
sudo -H vi /etc/environment
/home/linuxbrew/.linuxbrew/bin/
in itUpvotes: 0
Views: 346
Reputation: 15924
If you want commands to run when starting fish, you need to put them into a file called "config.fish" in ~/.config/fish/. Bashrc is, as the name implies, specific to bash.
Also "export" is used to mark a variable for "exporting", meaning passing it on to external commands the shell starts. $PATH is usually inherited from whatever starts the shell, which then means it's exported anyway, so your export
line is useless.
Also your fish command needs a slight adjustment:
set PATH $PATH /home/linuxbrew/.linuxbrew/bin/
$PATH in fish is a list, and so it needs to be set as multiple arguments, not one string. In fish 3.0 (which was released after Ubuntu 18.04) this was adjusted to automatically split on ":", but even in that case you'll have to quote it or it will have surprising results.
Upvotes: 3