The fish shell and executing programs from bash through `function` The fish shell and executing programs from bash through `function` bash bash

The fish shell and executing programs from bash through `function`


When you run bash file_name it means you're trying to run file_name as a bash script.

Try this instead:

bash -c '$HOME/lib/atom/bin/Atom/atom "$@"' dummy $argv

The -c means "run this command with bash" instead of "run this script with bash".

As Charles pointed out in the comments, we have to do a bit of tweaking to pass the parameters to the command. We pass them to bash which will use them as positional parameters inside of the supplied command, hence the $@.


should be: bash -c '$HOME/lib/atom/bin/Atom/atom "$@"' _ $argv

The underscore will become bash's $0

A demo:

$ function test_bash_args      bash -c 'printf "%s\n" "$@"' _ $argv  end$ test_bash_args one two threeonetwothree

If you need that bash session to load your configs, make it a login shell.

So, bottom line: ~/.config/fish/functions/start-atom.fish

function start-atom    bash -l -c '$HOME/lib/atom/bin/Atom/atom "$@"' _ $argvend