Ca

Call Bash/ZSH/POSIX shell functions and built-ins from Fish

Hacker News

Call Bash/ZSH/POSIX shell functions and built-ins from Fish

Wanted to share a little tool I made that I'm calling `pisciform.fish`, heavily inspired by replay.fish[1] and bass.fish[2], but with a bit more oomph. The tool allows you to create a fish function that mirrors a function definition from another shell. Because a shell function can mutate the calling environment (similar to using `source` on a shell script), the main mechanic of the wrapper is to look for environment mutations and play them back in the calling fish shell. This technique for bridging the different shell environments is inspired by replay and bass, but there are some slight differences. The README for the repo provides a more detailed overview, including a more detailed explanation of how this tool differs from what already exists. My motivation for making this is the fact that I've wanted to move over to `fish` for years for personal preference, but I was held back by a handful of things: 1. I like to create and share shell tools with my teams in professional settings, and getting a whole team to move to `fish` is likely a non-starter; plus, POSIX or Bash or ZSH are the lingua franca of shell scripting (short of Python). 2. While a shell script with a shebang is already portable, I prefer writing shell functions over writing shell scripts when feasible for a variety of reasons. 3. I'm coming from ZSH, where both replay and bass only speak Bash. 4. Most of the ZSH tools that I've written over the years are autoloadable function files, which can't just be `source`'d. 5. These are sometimes complicated tools that do more than just export variables, which bass and replay are more oriented towards. I needed to be able to run arbitrary commands, support interactivity, etc. --- [1]: https://github.com/edc/bass [2]: https://github.com/jorgebucaran/replay.fish

Share card

Actual performance

1points
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Strong signals: including · Missing: supports, reddit linkedin, podcasting
80%80% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Product HuntOn track for Day 1 leaderboard · Strong signals: activity, using · Missing: mac, agents, macos
62%62% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
AppSumoStrong fit for a featured deal · Strong signals: plus · Missing: platform, intuitive, reviews
55%55% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: exist, ide, io · Missing: https docs, excited, just released
51%51% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRLess likely to generate early MRR · Strong signals: personal · Missing: mobile apps, ios, entrepreneurs
46%46% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
12%12% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Incorrect prediction on native model

Similar products

Fi
Fisherman – Fish Shell Manager52%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Fisherman – Fish Shell Manager

Hacker News13
Sh
Shark – A fast sparkline generator for Fish shell52%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Shark – A fast sparkline generator for Fish shell

Hacker News5
Ac
Accidental `poweroff` Guard for Fish-shell53%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Accidental `poweroff` Guard for Fish-shell

Hacker News2
Fi
Fisher – a package manager for the fish shell56%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Fisher – a package manager for the fish shell

Hacker News5
Fi
Fisher 3.0 – the package manager for the fish-shell56%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Fisher 3.0 – the package manager for the fish-shell

Hacker News6
Fi
Fish-shell-style path abbreviation in Bash43%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Fish-shell-style path abbreviation in Bash

Hacker News3
Mo
Monokai Theme for OS X Terminal and Fish Shell53%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Monokai Theme for OS X Terminal and Fish Shell

Hacker News2
Ch
Chernoff Fish44%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Chernoff Fish

Hacker News2
Ge
Getopts(1)-like CLI parser for fish-shell46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Getopts(1)-like CLI parser for fish-shell

Hacker News2
Sh
Shell Roulette55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Shell Roulette

Hacker News1