Closed jorgebucaran closed 5 years ago
Hi @jorgebucaran. That is a nice and elegant solution, and it works well! Thanks for sharing! I will update README to mention that.
The downside I can see is that every time that line is run, you will start a new fish shell. So among other things, it will not have access to variable you set earlier.
 ~/Downloads/imports
$ set x 1
 ~/Downloads/imports
$ echo $x
1
 ~/Downloads/imports
$ exec bash -c "export y=2; exec fish"
Welcome to fish, the friendly interactive shell
 ~/Downloads/imports
$ echo $y
2
 ~/Downloads/imports
$ echo $x
You also cannot use it in a fish function or script, because it will terminate the fish process that is running the function/script.
Hi @edc! 👋
I've been running some experiments and noticed I could use
exec bash -c ...
instead ofbass
for doing the same thing. I was wondering if you were aware of this or if I was missing something.One thing this code is missing is setting the exit status when
bash
fails, but I could live without that.