I'm using iTerm on my Mac and I have a .bash_profile that I have been comfortably using. I recently got to know about fish bash and I installed it on my Mac and all of a sudden my .bash_profile is not being sourced. Any ideas as to why I could not see it?

How could I instruct my iTerm and fish to source my .bach_profile like it was doing before without fish?

  • 1
    fish uses ~/.config/fish/config.fish for configuration. – DavidPostill Dec 1 '16 at 17:13
  • 3
    fish is not bash. It's a different language with a different syntax. If there are functions or aliases you want to keep, you'll need to rewrite them. Be sure to read the tutorial – glenn jackman Dec 1 '16 at 18:13
  • Could you post me some examples? All I have in my .bash_profile are just some exports and some aliases. I would like to reuse them for fish! – sparkr Dec 2 '16 at 4:43
  • 1
    Possible duplicate of re-use '~/.profile` for Fish? – Daniel Centore Jan 4 at 5:17
up vote 3 down vote accepted

Fish has exactly one user controlled config file which is named $HOME/.config/fish/config.fish by default. Fish also has an export command for compatibility with bash/zsh/sh but it just a thin wrapper around the fish form:

set -gx VAR value

As for bash aliases you have two choices: turn them into abbreviations (see the "abbr" command) or functions. In fish you can define a function with its "alias" command but that simply turns

alias myalias some_command --arg1 --arg2

into

function myalias; some_command --arg1 --arg2 $argv; end

As Glenn Jackman pointed "fish is not bash". It is not an improved bash. Switching to fish isn't hard but does require a little effort. I made the switch 13 months ago and think it is worth the effort.

  • after doing this how do I do the equivalent of source ~/.bash_profile – wfbarksdale Mar 25 at 3:00
  • @wfbarksdale – source ~/.config/fish/config.fish. – leymannx Oct 12 at 11:01

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.