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

che.sh does not run #2295

Closed
ghost opened this issue Sep 1, 2016 · 9 comments
Closed

che.sh does not run #2295

ghost opened this issue Sep 1, 2016 · 9 comments
Labels
kind/bug Outline of a bug - must adhere to the bug report template.
Milestone

Comments

@ghost
Copy link

ghost commented Sep 1, 2016

eugene@eugene:~/projects/artik-ide (alpine_based_image)$ ./artik.sh info
./artik.sh: 420: ./artik.sh: Syntax error: "(" unexpected (expecting "fi")

OS and version: Ubuntu 14.04

Happens both to artik-ide.sh and che.sh

@ghost ghost added the kind/bug Outline of a bug - must adhere to the bug report template. label Sep 1, 2016
@andresbono
Copy link

Same problem here.

@ghost
Copy link
Author

ghost commented Sep 1, 2016

@andresbono what's your OS and version please?

@andresbono
Copy link

OS and version: Ubuntu 16.04.1 LTS

@andresbono
Copy link

@eivantsov I think the problem would be fixed changing line 420 from che.sh file
PROPERTIES_ARRAY=($(env | grep CHE_PROPERTY_))
to
PROPERTIES_ARRAY=$(env | grep CHE_PROPERTY_)

Hope it helps you too.

@TylerJewell
Copy link

@andresbono - that syntax will break on mac + windows.

If we need to do a truly posix implementation:
https://github.com/makefu/array
http://stackoverflow.com/questions/6499486/how-to-mark-an-array-in-posix-sh

@andresbono
Copy link

@TylerJewell Oh, I missed that.

As the compound assignment ARRAY=(value1 value2 ... ) is bash syntax and not part of the POSIX sh specification, would it be suitable to change shebang from #!/bin/sh to #!/usr/bin/env bash? As far as I know, /bin/sh is a link to /bin/dash on Debian family.

@TylerJewell
Copy link

It may be! If you change that on Ubuntu, does it run? I have access to a windows and mac box that I can test. I have to tell you - these posix shell issues are a real pain in the rear end. We keep running into them, even though we run different tests.

@TylerJewell
Copy link

@andresbono - we have decided to add the right shebang - tested on mac, windows and ubuntu - all ok. The PR was just merged.

#2306

@andresbono
Copy link

@TylerJewell Great! I also think it is the best solution. Glad to have helped.

@bmicklea bmicklea added this to the 4.8.0 milestone Sep 1, 2016
@bmicklea bmicklea mentioned this issue Sep 1, 2016
57 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants