Skip to content

Bug in arduino-linux-setup.sh affecting non-bash users #9281

Closed
@jwcollins

Description

@jwcollins

Hi. This script has an obvious, but easily fixed bug. Currently there are a bunch of comments before #!/bin/bash. And it assumes, very incorrectly, that pound-bang /bin/bash is a comment. In fact, "#!" is a valid Unix/Linux magic number, and "/bin/bash" is the path to the program which needs to interpret / execute the script. When run by a user who uses /bin/bash as their everyday shell, it works, but only because the user happens to have invoked bash. But when run by a user who uses another shell (e.g. /bin/tcsh) as their shell, it doesn't work, because pound-bang is not at the top of the file, and thus /bin/bash is not invoked to execute the script. And since the script is written to bash, as opposed to tcsh (or ksh or ... ) syntax, it won't work.

This bug report is against distribution 1.8.10. Screen capture of trying to run this script from a non-bash shell is pasted below. Read the below wikipedia link, which mis-pronounces "pound-bang", but is otherwise valid. This construct has worked since handed down by Real Programmer Dennis Ritchie in Jan 1980. Please learn it.

https://en.wikipedia.org/wiki/Shebang_(Unix)

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS: LinuxSpecific to the Linux version of the Arduino IDEType: Bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions