You are not logged in.

#1 2023-10-09 10:21:39

sshadows
Member
Registered: 2023-10-09
Posts: 3

[SOLVED]How to use source command to run .bash file in fish?

I am learning ROS recently, but many files in ROS can only be run with .bash and .zsh. I personally prefer to use fish. I have also tried to use the bash command in fish to run it, but the results are different from the source command.

Last edited by sshadows (2023-10-10 11:15:41)

Offline

#2 2023-10-09 12:03:05

ayekat
Member
Registered: 2011-01-17
Posts: 1,590

Re: [SOLVED]How to use source command to run .bash file in fish?

What are those files specifically, or what do you mean with "run"? Are the files meant to be sourced by your interactive shell, or are they just scripts to be executed?

If it's the latter (executable scripts), then your interactive shell does not matter; just run them as you would any other script written in Python, Perl, ….

If it's the former (must be sourced), then it looks like there's no real/official way, but some very cursory Web-searching reveals a few workaround solutions, the most prominent one being bass (note that I don't use fish and can't assess if it's actually useful).


pkgshackscfgblag

Offline

#3 2023-10-09 12:16:42

sshadows
Member
Registered: 2023-10-09
Posts: 3

Re: [SOLVED]How to use source command to run .bash file in fish?

ayekat wrote:

What are those files specifically, or what do you mean with "run"? Are the files meant to be sourced by your interactive shell, or are they just scripts to be executed?

If it's the latter (executable scripts), then your interactive shell does not matter; just run them as you would any other script written in Python, Perl, ….

If it's the former (must be sourced), then it looks like there's no real/official way, but some very cursory Web-searching reveals a few workaround solutions, the most prominent one being bass (note that I don't use fish and can't assess if it's actually useful).

Ok. Thanks. The file is the former, and I have already changed my shell to zsh because I can't solve the problem by myself.

Offline

#4 2023-10-09 12:28:47

ayekat
Member
Registered: 2011-01-17
Posts: 1,590

Re: [SOLVED]How to use source command to run .bash file in fish?

Is the bass approach not working for you, and if so, why? What else have you searched or tried?


pkgshackscfgblag

Offline

#5 2023-10-10 11:15:15

sshadows
Member
Registered: 2023-10-09
Posts: 3

Re: [SOLVED]How to use source command to run .bash file in fish?

ayekat wrote:

Is the bass approach not working for you, and if so, why? What else have you searched or tried?


It seems my problem has been solved so far. I have successfully run the .bash file in fish through bass. Thanks!

Offline

Board footer

Powered by FluxBB