I would want to continue to write my scripts with sh or bash, but is this something worth adopting for just regular shell navigation?
I’ve thought about it previously but it not being a default shell makes it reasonably less appealing for me.
As long as you use bash in your shebang you won’t know the difference. Fish even has conventions for applying environment variables to be available in both shells. I’ve used Fish for a couple years and my biggest gripe (which is still minor) is that command snippets off the Internet don’t always work. In those cases I either switch to bash temporarily or fix the command to work in Fish.
Most of the time the fix is: put quotes around your strings (especially when they may contains globing patterns). Sometimes its using newer syntax available in bash but not on the snippet.
I’ll check it out then. Work involves using bash exclusively because it’s embedded systems but I’ll see if fish suits me for personal use. Thanks for the suggestions
I just set Fish as the shell that my terminal emulator should launch. The actual default/system shell can stay Bash. And then, yeah, if you put Bash into the shebang, all the scripts will run with it, and you can just execute bash in your Fish shell at any point to drop into a Bash shell.
Occasionally, I’ll realize some syntax discrepancy where I’ve kind of learned it the Fish way, but because I’m only using Fish interactively, there’s really not a ton of syntax that I’m interacting with.
And yeah, ultimately I find it well worth it. In particular the history-based auto-suggestions are really useful. People will ask me what that command was again and I’ll start typing into my shell and it just pulls out exactly what I wanted in quite a lot of cases.
Well, I’m talking about my team members at my dayjob. I’m a software engineer.
But it’s also a lot less explicit than what you’re probably imagining. It’s rather that we have a meeting and realize that a problem re-occurred which we thought we solved months ago. So, then everyone starts collectively scratching their head and somewhat rhetoric questions might be thrown into the room, i.e. “Oh man, do you still remember how we did that?”.
Then I might start typing the command how I think it would probably begin, often with the intention of then putting --help at the end to try to jump-start my memory. And then that’s where Fish often jumps in and tells me that I’m apparently typing the exact beginning letters of the command that we used a few months ago.
Sometimes this even happens when I have no recollection that I ran a given command before, and someone’s just generally asking how to do a certain task…
I felt that way too, but testing it for a few days on one device changed my mind. Their pitch rings true, it has so many basic QoL features that make you wonder why this wasn’t added to bash two decades ago.
For me, the only bash->fish gripe I’ve had was it took me a little while to get used to having to put quotes around URLs with a ? to stop it trying to wildcard, but again, their rationale makes perfect sense and really I admit it was bad for bash to simply accept that string in the first place.
I would want to continue to write my scripts with sh or bash, but is this something worth adopting for just regular shell navigation?
I’ve thought about it previously but it not being a default shell makes it reasonably less appealing for me.
As long as you use bash in your shebang you won’t know the difference. Fish even has conventions for applying environment variables to be available in both shells. I’ve used Fish for a couple years and my biggest gripe (which is still minor) is that command snippets off the Internet don’t always work. In those cases I either switch to bash temporarily or fix the command to work in Fish.
Most of the time the fix is: put quotes around your strings (especially when they may contains globing patterns). Sometimes its using newer syntax available in bash but not on the snippet.
This is what I do.
Fish for daily usage and when I need to write a script or use a snippet from the web, I drop to bash for a sec. Totally worth it.
I’ll check it out then. Work involves using bash exclusively because it’s embedded systems but I’ll see if fish suits me for personal use. Thanks for the suggestions
Yes, Fish excels at being an interactive shell.
I just set Fish as the shell that my terminal emulator should launch. The actual default/system shell can stay Bash. And then, yeah, if you put Bash into the shebang, all the scripts will run with it, and you can just execute
bash
in your Fish shell at any point to drop into a Bash shell.Occasionally, I’ll realize some syntax discrepancy where I’ve kind of learned it the Fish way, but because I’m only using Fish interactively, there’s really not a ton of syntax that I’m interacting with.
And yeah, ultimately I find it well worth it. In particular the history-based auto-suggestions are really useful. People will ask me what that command was again and I’ll start typing into my shell and it just pulls out exactly what I wanted in quite a lot of cases.
Who asks about your history? Genuinely curious.
Well, I’m talking about my team members at my dayjob. I’m a software engineer.
But it’s also a lot less explicit than what you’re probably imagining. It’s rather that we have a meeting and realize that a problem re-occurred which we thought we solved months ago. So, then everyone starts collectively scratching their head and somewhat rhetoric questions might be thrown into the room, i.e. “Oh man, do you still remember how we did that?”.
Then I might start typing the command how I think it would probably begin, often with the intention of then putting
--help
at the end to try to jump-start my memory. And then that’s where Fish often jumps in and tells me that I’m apparently typing the exact beginning letters of the command that we used a few months ago.Sometimes this even happens when I have no recollection that I ran a given command before, and someone’s just generally asking how to do a certain task…
I’ve shared commands with friends and they ask for them again. I imagine similar context here
I felt that way too, but testing it for a few days on one device changed my mind. Their pitch rings true, it has so many basic QoL features that make you wonder why this wasn’t added to bash two decades ago.
For me, the only
bash
->fish
gripe I’ve had was it took me a little while to get used to having to put quotes around URLs with a?
to stop it trying to wildcard, but again, their rationale makes perfect sense and really I admit it was bad for bash to simply accept that string in the first place.