0xacx / chatGPT-shell-cli

Simple shell script to use OpenAI's ChatGPT and DALL-E from the terminal. No Python or JS required.

Home Page:https://gptshell.cc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why bash? wouldn't sh be enough?

jaromil opened this issue · comments

The script is still small enough to migrate to /bin/sh without much effort, leading to a more portable script. I would suggest you do so.

commented

What would the advantages be in practice?
I mean, what modern system does not support bash but supports sh?
The only case I could think of is running this script in alpine linux images, where bash is not included, but even there it can be easily installed.
In short, I don't see the reason to restrict to sh functionality for benefits that are not clear to me.
@jaromil Lmk what you think!

@jaromil What is failing on your end? Could you give more detail? It works fine on my end on all zsh, bash, and sh.

Nothing failing! I have been scripting a lot in zsh and bash, nowadays I wish it would have been all in sh: portable and easier to analyse with stuff like shellcheck. Also BSD systems have native support without installing anything else.

commented

@jaromil I agree with that but don't you miss some bash functionality that sh doesn't have? A short list of the most important points is here I like and use some of these features in this script.