Hello I want to use FISH as my main shell and I have to prepend some directories/files to $PATH. I followed the guide on the ArchLinux wiki for prepending to $PATH but I ran into issues. This is the error message, I get it every time I start my Shell. But I can still use it afterwards:
~/.config/fish/config.fish (line 1): The expanded command was empty. $fish_add_path -p /usr/bin/fish ~/.bash.profile /ect/bash.bashrc ~/.bashrc /usr/local/texlive/2024/x86_64-linux ^~~~~~~~~~~~~^ from sourcing file ~/.config/fish/config.fish called during startup
And what I have written in my config.fish is: $fish_add_path -p /usr/bin/fish ~/.bash.profile /ect/bash.bashrc ~/.bashrc /usr/local/texlive/2024/x86_64-linux
I'm using Manjaro I3 and fish version 4.0.0.
I already tried to type this command in the terminal, it didn't work though: set -U fish_user_paths; /usr/local/bin $fish_user_paths
And in most other cases people were using old fish versions and when they updated their FISH shell it worked.
Hello I want to use FISH as my main shell and I have to prepend some directories/files to $PATH. I followed the guide on the ArchLinux wiki for prepending to $PATH but I ran into issues. This is the error message, I get it every time I start my Shell. But I can still use it afterwards:
~/.config/fish/config.fish (line 1): The expanded command was empty. $fish_add_path -p /usr/bin/fish ~/.bash.profile /ect/bash.bashrc ~/.bashrc /usr/local/texlive/2024/x86_64-linux ^~~~~~~~~~~~~^ from sourcing file ~/.config/fish/config.fish called during startup
And what I have written in my config.fish is: $fish_add_path -p /usr/bin/fish ~/.bash.profile /ect/bash.bashrc ~/.bashrc /usr/local/texlive/2024/x86_64-linux
I'm using Manjaro I3 and fish version 4.0.0.
I already tried to type this command in the terminal, it didn't work though: set -U fish_user_paths; /usr/local/bin $fish_user_paths
And in most other cases people were using old fish versions and when they updated their FISH shell it worked.
Share edited Mar 7 at 16:23 NoelR0 asked Mar 7 at 16:11 NoelR0NoelR0 214 bronze badges 1- What did you do exactly? What are the error messages you received? Please put those as text into your question, not as linked images. – Ulrich Eckhardt Commented Mar 7 at 16:18
1 Answer
Reset to default 1There are multiple issues here.
The first: You copied the command wrong.
When documentation like https://wiki.archlinux./title/Fish shows a $
at the beginning of a line, that's usually meant to be the prompt symbol. It is not part of the command you should run, but a representation that you should ignore when copying.
So you ran
$fish_add_path -p ...
when you should have run
fish_add_path -p ...
without the $
. The $
causes fish to interpret it as a variable, and there is no variable by that name. So it tells you that it's empty and so it doesn't have a command to run.
----
The second issue: The paths you are passing here are not paths you want to add to $PATH.
/usr/bin/fish ~/.bash.profile /ect/bash.bashrc ~/.bashrc /usr/local/texlive/2024/x86_64-linux
"/usr/bin/fish" is the fish executable. $PATH contains directories, not files, and /usr/bin will already be included (or your system is super borked).
~/.bash.profile is a misspelling of ~/.bash_profile
, and that is also a file, and it is a bash configuration file, so adding that to $PATH makes no sense - that's not how $PATH works. Same with "/ect/bash.bashrc" (which would be /etc/bash.bashrc
) and ~/.bashrc.
/usr/local is most likely already included. It won't really harm to include it here, I suppose.
/usr/local/texlive/2024/x86_64-linux might be an actual directory that might make sense to add.
----
You should read up on what $PATH does and is, and figure out what exactly you want to achieve by adding .bash_profile and bashrc to it.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744918515a4600984.html
评论列表(0条)