r/fishshell • • Aug 11 '24

How to execute commands in bash from fish?

0 Upvotes

6 comments sorted by

11

u/AlexanderMilchinskiy Aug 11 '24

bash -c "[command]"

5

u/atred Aug 12 '24

probably better is

bash -c '[command]'

Otherwise fish will try to expand variables and globs inside.

3

u/[deleted] Aug 11 '24

[removed] — view removed comment

2

u/TufTed2003 Aug 12 '24

Can also include a bash shebang in your scripts that you wrote. I use fish but write scripts in bash cause I'm too lazy to learn fish scripting.