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

Use proper shell in launch script #46

Merged
merged 1 commit into from
Apr 12, 2016
Merged

Use proper shell in launch script #46

merged 1 commit into from
Apr 12, 2016

Conversation

pingtimeout
Copy link
Contributor

If one is using another shell than bash (i.e. zsh, fish, ...) when running
./mjprof, the command will fail with this error:

./mjprof1.0/mjprof: 2: ./mjprof1.0/mjprof: Bad substitution

This fix solves the issue by explicitely asking the executing shell to be an
instance of bash.

If one is using another shell than `bash` (i.e. zsh, fish, ...) when running
`./mjprof`, the command will fail with this error:

```
./mjprof1.0/mjprof: 2: ./mjprof1.0/mjprof: Bad substitution
```

This fix solves the issue by explicitely asking the executing shell to be an
instance of `bash`.
@lifey lifey merged commit 2de8f55 into AdoptOpenJDK:master Apr 12, 2016
@pingtimeout pingtimeout deleted the patch-1 branch April 12, 2016 08:34
@pingtimeout
Copy link
Contributor Author

I think you have a bash compatibility mode enabled in your shell. The
${BASH_SOURCE[0]} variable does not exist in zsh. There is a
replacement though. See:
http://stackoverflow.com/questions/9901210/bash-source0-equivalent-in-zsh

The idea is: if the shebang specifies /bin/sh, any sh compatible shell
can be used (including zsh). As long as you have some bash compatibility
magic happening, everything works smoothly. However when you don't, it
fails with that error. Now that the shebang specifies /bin/bash
explicitly, a bash instance will always be launched and that will solve the
error.

Pierre Laporte
@pingtimeout https://twitter.com/pingtimeout
pierre@pingtimeout.fr
http://www.pingtimeout.fr/

On Tue, Apr 12, 2016 at 10:28 AM, Haim Yadid notifications@github.com
wrote:

Sorry for the late response. I am working with zsh and it works perfectly
for me.
#!/bin/sh is selected.
I don't understand how changing it to bash will help


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#46 (comment)

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

Successfully merging this pull request may close these issues.

2 participants