Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bashisms #8

Open
dertuxmalwieder opened this issue Nov 18, 2022 · 5 comments
Open

Remove bashisms #8

dertuxmalwieder opened this issue Nov 18, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@dertuxmalwieder
Copy link

In order to be more compatible with several operating systems (not all UNIX-like systems have a bash installed), it might be a good idea to get rid of the bashisms and set the shebang to /bin/sh instead. As far as I can see, there is no functionality that would need to be removed:

  • echo -e does not seem to be necessary where it occurs -> remove the -e
  • read -p would need to be rewritten as printf "some text" ; read -r
  • $(...) - inconsequently used in this script anyway - should be replaced with backticks
  • the [[ var == text ]] syntax only needs minor changes

The benefit from this would be that nobody would need to use a bash with all of its dependencies -> even lower entry point.

@duxsco
Copy link

duxsco commented Nov 18, 2022

fyi, regarding:

@duxsco
Copy link

duxsco commented Nov 18, 2022

shellcheck should be used prior to publication, or the script should be declared as alpha.

@shombando shombando added the enhancement New feature or request label Nov 18, 2022
@shombando
Copy link
Owner

Thanks @dertuxmalwieder and @duxsco, I'll investigate and work towards removing bash dependency.

@duxsco
Copy link

duxsco commented Nov 18, 2022

I don't mind bash dependency 🙂, but I can understand people wanting to see /bin/sh used if sufficient.

@dertuxmalwieder
Copy link
Author

Thank you for the additions, @duxsco :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants