The Web site for fish reads:
Finally, a command line shell for the 90s
I love them and always will.
dash
i am using ZSH cause Fish is not POSIX compliant,which made it annoying to run scripts without rewriting them.
#!/bin/sh
Hope this helps
how about if its not in a sh file,its common for scripts to use sh or bash instead. but am just gonna stick to ZSH anyways
Linux doesn’t generally use extensions to decide what shell to use, so it doesn’t matter if it’s an sh file or not.
If it uses bash of course you can substitute #!/bin/bash
And of course you can use whatever shell you want, just saying that POSIX-compliance is not really relevant since the script can specify what shell it needs.
The file extension doesn’t matter much on Linux. If you’ve got a shebang at the top, the shell you’re running from will invoke the correct shell according to the shebang.
In some situations, you may want to use something like
bash <your-script>, but that would only be when you’ve got a script that doesn’t have a shebang, but not having one is bad practice and you really should be using them. Fish isn’t the only non-POSIX shell you’re going to encounter on a Linux system. Python, Perl, and probably some others will be there, and using a shebang ensures no shenanigans. So whether or not you use Fish, you should always use shebangs.
When is this a problem? What scripts don’t use a shebang and/or why does using
shcall fish instead of bash or dash?I have a mild dislike of fish because a few substitutions are different enough that my muscle memory isn’t there. (But I also haven’t put in serious effort to learn them.)
I think they don’t use shebang
Have you run into a specific problem or is this just a hypothetical you’re worried about. I see this a lot but haven’t ever actually run into it being a concern. If you run a script with
from a Fish shell, it won’t use Fish, it will use whatever you haveshpointing to. (Which shouldn’t be Fish, it’s usually bash or dash.)I ran into issues on fish,i don’t remember what they are but I think it’s no shebang
Ah, I see. If you don’t remember, don’t sweat. I’m mostly curious just because posix issues is one of the few complaints I hear but I never see anything specific so I’m extremely curious lol. Please don’t mistake this as one of those fanboyism moments where people try to say something they like is actually perfect and doesn’t have flaws.
My understanding of shebangs is that it isn’t your shell doing anything fancy with it, it’s your OS (or something, I don’t remember exactly, but it’s lower level than the shell). So maybe something else borked. But I’m no fish expert, I have some error in some fish thing that prints an error every time I open a new shell that I’m too lazy to troubleshoot lol.
I use fish because it was the default in cachyos and decided to give it a fair shake. I like the built in syntax highlighting and fancy autocomplete but I miss bash scripting and built in commands that replace standard commands can be weird sometimes. I have not tried scripting fish, to lazy to learn yet another scripting language, especially if bash is the (almost) de-facto standard.
You can always just continue using bash scripting, with a bash shebang in your scripts, if you miss it
That’s what I do. Fish is great as interactive shell, scripts don’t benefit that much from it and I can use what’s familiar.
I’ve been using it for awhile now for the same reason, and think I’m going to switch back to sh as it has too many suggestions which I read and it interrupts my thoughts and slows me down.
I like having fish as an option, but don’t think I’d ever use it as my default.
If I have a long command that uses long filenames, or I don’t remember the syntax of something, I can just type “fish” and it’ll open up a fish shell.
I’ve never understood the need for
fish. The shell experience is basically the same aszsh, and although it’s much more pleasant to script for, you miss out on compatibility with POSIX-compliant snippets, and besides, if you’re writing long and complicated scripts that need anything more than a handful of scalar variables you should probably be using Python (or Perl if you’re an old-school masochist).I can’t begin to say how superior my fish rice is to any alternative. So I won’t. And I’ll leave yall to flame me for implying it.
All we ask of you is that you don’t reheat it in the employee break room microwave.
I think I’m using fish and it works great, I love alt+s thing and auto complete thingy.
TIL the alt+s thing
If you’re not using fish:
sudo !!Yes.
But: Bash: alias please=‘sudo $(history -p !!)’ Zsh: alias please=‘sudo $(fc -ln -1)’
Or if you are on ZSH: press escape twice. Does require OhMyZSH with sudo plugin.

Huh. Alt+s. I forgot about that. I think maybe something in my tmux config makes it not work. Not to worry, I’ve made use of fish’s abbreviations, and have other nice things, like I type tssr and space, and it types out "time sudo strat -r " for me.
Well over a decade using fish, and still finding new treats. It’s so cushy out of the box, without even trying to learn it, it’s easy to miss that there’s so much more. I only started using abbr in the past year or so.
I learned that shortcut when someone was talking about shells. I like that I learn new stuff about Linux too.
telnet
⚰️
No such thing as a good shell… (I just want something that’s both posix-compatible and good)
That’s a paradox. POSIX shells are all bad because POSIX demands bad syntax.
You can have pain word strings without also having weird “variables auto-explode into words” bullshit.
That’s why I use nushell. It has lists. You do
cmd ...$some_listto call a command on arguments from a list.I’m ok with that part, I’m talking more performance and convenience. POSIX isn’t the most amazing but it’s ok. And whether I like it or not, I’ll have to use a posix-compatible shell if I want to run most scripts.
I luckily don’t have to modify scripts these days so I’ll just use bash to run them if there’s no better alternative around. And usually it is, few things are only available as bespoke shell script
friend brought me some seashells

Heh. Good stuff.
More! ;D I want to see all the shells, characterised so.
… Fish [over[1]]user here. Ooh, good burn. LOL.
[1: Not just user. Overuser. I do most of my scripting in fish. Think that’s not overuse yet? … I even wrote my own text editor in fish.]
When I installed freeBSD for the first time, I was so confused when !! didn’t work.
Where’s tcsh?
Came here for this.
tcsh is the bees knees.















