I have a collection of bash scripts that I have added to the PATH so that I can execute them from anywhere.

export PATH=$PATH:~/<path>/<to>/<scripts>

so along with


I can use


This all works as expected from bash but not from within fish-shell. I have to call bash and pass the script path as an argument, and any other arguments while executing:

bash ./<path>/<to>/<scripts>/mt-sync-github-projects <other-arguments-if-at-all>

I have verified that even though I did not add the location to fish's PATH explicitly, it does show me the right value for PATH using echo $PATH and the scripts have a shebang specifying that they are to be executed as a bash script:

#!/usr/bin/env bash

Am I missing something or doing it entirely the wrong way?

  • 1
    What happens when you try to execute your bash script from fish? Do you get an error?
    – Peschke
    Jul 23, 2019 at 22:43
  • The fish shell would use set -x PATH $PATH ~/<path>/<to>/<scripts>, not export (it's not really a POSIX shell). But it's not clear where you do that export thing to add to the PATH.
    – Kusalananda
    Jul 23, 2019 at 22:48
  • Where is the export PATH=... line? Is that something you typed into the console or is it in a config file? If so, which config file? Jul 23, 2019 at 23:35
  • I made an attempt to create an arrangement in my dotfiles that would work with both bash and fish, tried to extract as many common elements as possible so that I do not need to configure both separately. The export is here
    – myTerminal
    Jul 24, 2019 at 4:06
  • 2
    That file is not valid fish syntax. fish does not claim to be a POSIX compatible shell, it is a different beast. I would not recommend spending any effort trying to find common ground, and put that effort into using fish syntax to configure your fish shell. Jul 24, 2019 at 4:11


You must log in to answer this question.

Browse other questions tagged .