Chumicat
Chumicat

Reputation: 302

Set $path fail (win10 subsystem linux, ubuntu, fish shell, brew)

Environment

target

I want to use PHP with "php" command which brew had installed but fail.

What I had done

Upvotes: 0

Views: 346

Answers (1)

faho
faho

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

Related Questions