Skip to content

Non portable shebang for bash #3003

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

Closed
pgiffuni opened this issue Apr 19, 2015 · 3 comments
Closed

Non portable shebang for bash #3003

pgiffuni opened this issue Apr 19, 2015 · 3 comments
Assignees
Labels
feature request A request to make an enhancement (not a bug fix) OS: Linux Specific to the Linux version of the Arduino IDE
Milestone

Comments

@pgiffuni
Copy link

!/bin/bash is very bad idea.

In essence some platforms (like *BSD or Solaris) don't have bash in that place so this will cause issues. You instead should use

!/usr/bin/env bash

Also Ubuntu has started a trend of avoiding bash since the standard shell (dash) is faster so it's better to use the more portable /bin/sh when possible. See:
https://wiki.ubuntu.com/DashAsBinSh

I left a suggested patch here:
https://code.google.com/p/arduino/issues/detail?id=1149&thanks=1149&ts=1429478083

@facchinm facchinm added Type: Bug Component: Core Related to the code for the standard Arduino API labels Apr 20, 2015
@ffissore ffissore added OS: Linux Specific to the Linux version of the Arduino IDE feature request A request to make an enhancement (not a bug fix) and removed Component: Core Related to the code for the standard Arduino API Type: Bug labels Apr 23, 2015
@ffissore ffissore added this to the Release 1.6.5 milestone May 29, 2015
@ffissore ffissore self-assigned this May 29, 2015
@pgiffuni
Copy link
Author

Thanks ...

I know it's not urgent but it looks like you only changed one line, while my patch reveals at least 4 occurrences of /bin/bash:
arduino-core/src/processing/app/i18n/pull.sh
arduino-core/src/processing/app/i18n/push.sh
build/linux/dist/arduino
build/build_pull_request.bash

It doesn't hurt to fix them all.
(The first 2 work with plain /bin/sh)

@ffissore
Copy link
Contributor

Sorry, I haven't looked at your patched, I've missed it. Please, provide a pull request with all the necessary files changed

@pgiffuni
Copy link
Author

I am not a heavy user of git/github (yet).
Please just change /bin/bash for /usr/bin/env bash on the mentioned files.
That should be enough to get this building on FreeBSD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A request to make an enhancement (not a bug fix) OS: Linux Specific to the Linux version of the Arduino IDE
Projects
None yet
Development

No branches or pull requests

3 participants