Shell syntax produces error

Reported by Ben Beasley on 2010-11-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Exaile
Medium
Johannes Sasongko

Bug Description

Running the latest development version on Ubuntu 10.10, and having some issues with the fix for https://bugs.launchpad.net/exaile/+bug/671724 , checked in in r3765.

Running exaile from the terminal results in:

./exaile: 21: [[: not found

Seems that the double square bracket syntax is not recognized by Ubuntu's /bin/sh. The problem is in line 16 of the launcher shell script:

    if [[ `which python2 2> /dev/null` ]]; then

One option might be to use the backtick inside double quotes and single square brackets:

    if [ "`which python2 2> /dev/null`" ]; then

Or, we could test the return code of which:

    which python2 >& /dev/null
    if [ "$?" == 0 ]; then

Related branches

Johannes Sasongko (sjohannes) wrote :

Thanks. Your second alternative doesn't seem to work in dash, so I'm using the first.

Changed in exaile:
assignee: nobody → Johannes Sasongko (sjohannes)
importance: Undecided → Medium
milestone: none → 0.3.3.0
status: New → Fix Committed
Changed in exaile:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers