Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How come your scripts don't work with #!/bin/bash ?


Yeah, I keep seeing this complaint come up. Interesting that so many people don't realize you can run bash scripts from another shell without fanfare.


We realize, we're just doing something different than you are.


There's just a couple tricky ones in these scenarios.

For me, there's virtualenv and rvm that both mess with shell stuff deeply enough to where running them in fish can be tricky.

virtualenv has good fish support, but never really got rvm working. I ended up going back to zsh after 2 years or so in fish because of small issues like that and realising that so long as I had reverse search I wasn't really gaining much in productivity from fish.


rbenv has good fish support out of the box if you're willing to switch from rvm:

https://github.com/sstephenson/rbenv


In my terminal I usually have several tabs opened by default in fish, but have another open to the python repl, and sometimes bash if I need something. Easy enough to do.


Because we don't always source a shell script, you may need to source functions for certain functionality to work.


Imho "source" is an anti-feature. I think instead of "source", you always should create a subshell. It properly encapsulates your modified environment and avoids leakage and confusion. Exiting an environment is a straighforward exit/<ctrl>-D like with any shell. You do not need to remember a special "deactivate" command like with virtualenv.

Obviously, virtualenv and others disagree. ;)


I swear by subshells. They solve so many problems. People object that they don't let you do environment autoloading on `cd`, though (which I also hate, so... Yeah).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: