che.sh does not run

Created on 1 Sep 2016  路  9Comments  路  Source: eclipse/che

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

kinbug

All 9 comments

Same problem here.

@andresbono what's your OS and version please?

OS and version: Ubuntu 16.04.1 LTS

@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.

@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

@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.

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.

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

https://github.com/eclipse/che/pull/2306

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

Was this page helpful?
0 / 5 - 0 ratings