3 ms·
I recommended fish to some my younger coworkers recently only for somebody very senior to point out that they will be very confused copy-pasting commands meant
by vvpan 11mo ago
I recommended fish to some my younger coworkers recently only for somebody very senior to point out that they will be very confused copy-pasting commands meant for bash from the internet and them not working. He is right, I will hold off recommending fish. You have to know you are very ready for a new shell.
- kstrauser 11mo agoAbout the only common case for single line commands is that fish uses (cmd) instead of $(cmd) for subshells. Anything longer than that you should probably be pasting it into a file and executing that.
- kstrauser 11mo agoReplying to myself: I don’t get the downvotes here. One-liner Bash commands I stumble across almost always work as-is in Fish. A while back they added support for FOO=bar cmd to run cmd with the env var FOO set to bar, and that was the single biggest incompatibility I routinely stumbled across. Most commands you find in random docs tend to be that simple, and most work just as if you’d run them under Bash. But if it’s a large, complex command with if statements and for loops, etc., you’re better off pasting it into a file, then tweaking it to run under Fish or just running it directly via Bash.
- sph 11mo agoSomeone should tell the very senior dev that nothing stops you from running “bash” if you need to paste scripts.
- vvpan 11mo agoMinor errors stop juniors and people not used to the shell - they have no idea why something failed or really want to bother looking into it.
- dangus 11mo agoMmm, I don’t love this advice. I think the error messages fish gives out in these cases (usually related to quotations) explain the problem pretty well. I would probably recommend it like this: “I like using fish as my shell, if you want to try it out make sure you read the tutorial and generally understand that it’s not designed to be 100% bash/zsh compatible.” I picked up fish as a junior level engineer as well, it wasn’t very hard to adapt.