this post was submitted on 29 Dec 2024
218 points (99.5% liked)

Linux

48823 readers
741 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] Corr@lemm.ee 10 points 5 days ago (5 children)

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.

[–] BrianTheeBiscuiteer@lemmy.world 19 points 5 days ago (1 children)

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.

[–] Zykino@programming.dev 1 points 4 days ago

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.

[–] LiveLM@lemmy.zip 16 points 5 days ago (1 children)

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.

[–] Corr@lemm.ee 4 points 5 days ago

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

[–] markstos@lemmy.world 15 points 5 days ago

Yes, Fish excels at being an interactive shell.

[–] Ephera@lemmy.ml 4 points 4 days ago* (last edited 4 days ago) (1 children)

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.

[–] wuphysics87@lemmy.ml 1 points 4 days ago (2 children)

Who asks about your history? Genuinely curious.

[–] Ephera@lemmy.ml 4 points 4 days ago

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...

[–] Corr@lemm.ee 2 points 4 days ago

I've shared commands with friends and they ask for them again. I imagine similar context here

[–] comfy@lemmy.ml 4 points 4 days ago

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.