-2

I added a bunch of aliases to my .profile file. None of them work either.

My .bash_profile has one line: export PATH="$HOME/.npm-packages/bin:$PATH"

I went as far as creating a .bashrc file and putting source ~/.bash_profile in it.

Nothing I have tried is working, other than if I put source ~/.bash_profile into my shell every time I open a new one.

I have tried every stack overflow answer I could find and nothing is working.

Anyone out there can help me?

I am on mac, using fish, but same results in bash.

Samuel Liew
  • 76,741
  • 107
  • 159
  • 260
JamieTom
  • 101
  • 2
  • 14
  • As a first step of check, could you please check if path `$HOME/.npm-packages/bin` is present or not, may be by doing a `ls -ld $HOME/.npm-packages/bin` and let us know then? – RavinderSingh13 Mar 14 '19 at 05:39
  • yes it is present – JamieTom Mar 14 '19 at 05:40
  • 1
    Bash and Fish are completely different shells, there's no method that works for both. You should pick one and edit your question not to ask about the other – that other guy Mar 14 '19 at 05:56
  • 3
    See [this previous question about fish startup file(s)](https://unix.stackexchange.com/questions/211519/how-to-edit-the-fish-shell-startup-script/211529#211529). – Gordon Davisson Mar 14 '19 at 06:14
  • @GordonDavisson That worked, thanks! I added export PATH="$HOME/.npm-packages/bin:$PATH" as well as all of my aliases, to this file... ~/.config/fish/config.fish ... and now everything works properly in fish shell. As far as getting my bash shell to work properly, I followed [this answer](https://stackoverflow.com/a/902955/3316722) – JamieTom Mar 14 '19 at 06:25

1 Answers1

1

Fish is not, in general, bash compatible. That means it won't read bash's configuration files and if source works on them that's lucky (e.g. export var=val will work, var=val will not).

You need to either start fish from bash (and have all necessary variables exported), rewrite the necessary configuration for use with fish and add it to config.fish, or use something like https://github.com/edc/bass to read bash's changed environment from fish.

faho
  • 14,470
  • 2
  • 37
  • 47