5 ms·
I don’t follow… could you put #!/bin/bash at the top of your scripts, and still use it for scripting, but then use fish as your interactive shell?
by erikpukinskis 3y ago
I don’t follow… could you put #!/bin/bash at the top of your scripts, and still use it for scripting, but then use fish as your interactive shell?
- mcpackieh 3y agoI think this is what most fish users do. I suspect that failing to understand this is possible, due to not understanding how shebang scripts are executed by the kernel, is a major reason why bash remains popular for interactive use.
- joseph 3y agoIt's not that. We don't want to switch shell syntax between workstation and server, for example. The fish users I've known moved very slowly when they had to hop on a server, or build a new container image where it involved a 'docker run' into the shell to test it out. If you know bash or sh well enough to do those things quickly then there is no incentive to use fish.
- mcpackieh 3y agoBut `docker run` is the same in every shell. The only things that really change is the syntax for looping over files, advanced globing, things like that. Control-R, tab completion etc all works more or less the same with some minor quirky differences, but nothing that would slow somebody down. Context: I used bash for about 5 years, zsh for the next 10 before switching to fish.
- nimih 3y ago> If you know bash or sh well enough to do those things quickly then there is no incentive to use fish. I honestly think you might misunderstand why a lot of people use fish. I know bash “pretty well”—I’ve written and maintained my fair share of complex bash scripts, and remain pretty comfortable opening a shell in a running docker container or EC2 instance to debug various nonsense. What makes fish attractive to me for use as my login shell is the creature comforts which are very nice to have on my regular workstation, but aren’t really necessary when mucking around in some random environment: syntax highlighting, tab completion/autosuggestion/history search which “just works”, somewhat nicer syntax for writing simple scripts for personal use, saner word splitting, and so on. I guess I can’t really speak for other fish users and am perhaps biased by learned bash first a couple decades ago, but I don’t personally find it especially burdensome to have to remember multiple shell syntaxes/semantics (I already use half a dozen in my day to day work; what’s one more?), and I view it as a reasonable price to pay for a UI I find much more pleasant on whole.
- rany_ 3y agoNo, I mean creating some kind of quick program from the prompt itself. Like for instance bulk renaming of files from the prompt, there is no way I could do that quickly in fish's language and having to switch to bash to do that would be unnecessarily slow. Might as well stick to bash. What I mean to say is that fish would hurt my productivity rather than boost it.
- em-bee 3y agolearning any new tool takes a bit of time. but i believe you are overestimating the effort it takes to learn fish syntax. it is not that hard. you also need to consider the features in fish that boost your productivity that don't need to be learned at all. just give it a try.
- RulerOf 3y agoThis is the reason I was amenable to making the jump to zsh. With the customizations I have in my shell, my bash startup times were creeping into the multi-second territory, but I got a better UX and faster shell startup without having to learn new syntax for simple shell loops.