On 1 February 2013 11:31, Saptarshi Purkayastha <sun...@gmail.com> wrote: > oops, my bad. > This is a bash script with function calls. You'll need to work with it.
Exactly. Or just delete # get ready to catch errors and echo "Starting DHIS2 live ..." Trapping ctrl-c is only really interesting from command line anyway. > > You'll need to verify that the first line is indeed > #!/bin/bash > and the file has executable permissions I think he must be executing it somehow like 'sh startup.sh' which is maybe default on gui deskop shortcuts. This can probably be changed when creating the shortcut. > > --- > Regards, > Saptarshi PURKAYASTHA > > My Tech Blog: http://sunnytalkstech.blogspot.com > You Live by CHOICE, Not by CHANCE > > > On 1 February 2013 11:11, Bob Jolliffe <bobjolli...@gmail.com> wrote: >> >> Hi Neeraj >> >> This strange error seems to indicate you don't have a bash shell which >> is odd, or if you do its not being used. >> >> I see the error when I type 'sh startup.sh'. >> >> But when I explicitly type 'bash startup.sh' all is fine. Or even >> just './startup.sh' >> >> Can you confirm how you are starting this script? Maybe you have a >> shortcut which explicitly calls 'sh'. >> >> Also I would not suggest that dhis-live is the best option for running >> on ubuntu server if this is meant to be for production use. It uses a >> pre-canned set of JAVA_OPTS which you would more likely want to tune >> to your environment. >> >> Bob >> >> >> >> On 1 February 2013 10:01, Neeraj Gupta <neeraj.h...@gmail.com> wrote: >> > Lars, >> > >> > Below is the content of startup.sh >> > >> > #!/bin/bash >> > >> > # get ready to catch errors >> > trap ctrl-c INT >> > trap unexpected-exit ERR >> > >> > function ctrl-c () { >> > echo >> > echo "============================================" >> > echo "Keyboard interrupt" >> > echo "DHIS2 live exited" >> > echo "============================================" >> > exit >> > } >> > >> > function unexpected-exit () { >> > echo "============================================" >> > echo "DHIS2 live exited with an error" >> > echo "Make sure you have a java runtime in your path" >> > echo "============================================" >> > read -p "Press any key to exit" >> > } >> > >> > echo "Starting DHIS2 live ..." >> > # java -jar dhis2-live.jar >> > DHIS2LIVE=`dirname $0` >> > #$JAVA_HOME/bin/ >> > java -jar $DHIS2LIVE/dhis2-live.jar >> > echo "DHIS2 live exited normally" >> > >> > >> > >> > On Fri, Feb 1, 2013 at 3:14 PM, Lars Helge Ă˜verland >> > <larshe...@gmail.com> >> > wrote: >> >> >> >> Hi Neeraj, >> >> >> >> can you post the contents of the startup.sh script? >> >> >> >> Lars >> >> >> >> >> >> On Fri, Feb 1, 2013 at 11:26 AM, Neeraj Gupta <neeraj.h...@gmail.com> >> >> wrote: >> >>> >> >>> Hi Devs, >> >>> >> >>> I was trying to work with DHIS Live on Ubuntu Server 11.10 , but I am >> >>> unable to run it, when i am running startup.sh it is saying >> >>> trap: ERR: bad trap >> >>> /home/dhis-live/startup.sh: 7: Syntax error: "(" unexpected >> >>> >> >>> Downloaded it from http://www.dhis2.org/downloads >> >>> >> >>> Tried it on windows and it worked fine. >> >>> Does DHIS-Live work with Linux also or it works with windows only? >> >>> >> >>> >> >>> >> >>> -- >> >>> Thanks, >> >>> Neeraj Gupta >> >>> >> >>> _______________________________________________ >> >>> Mailing list: https://launchpad.net/~dhis2-devs >> >>> Post to : dhis2-devs@lists.launchpad.net >> >>> Unsubscribe : https://launchpad.net/~dhis2-devs >> >>> More help : https://help.launchpad.net/ListHelp >> >>> >> >> >> > >> > >> > >> > -- >> > Thanks, >> > Neeraj Gupta >> > >> > _______________________________________________ >> > Mailing list: https://launchpad.net/~dhis2-devs >> > Post to : dhis2-devs@lists.launchpad.net >> > Unsubscribe : https://launchpad.net/~dhis2-devs >> > More help : https://help.launchpad.net/ListHelp >> > >> >> _______________________________________________ >> Mailing list: https://launchpad.net/~dhis2-devs >> Post to : dhis2-devs@lists.launchpad.net >> Unsubscribe : https://launchpad.net/~dhis2-devs >> More help : https://help.launchpad.net/ListHelp > > > > _______________________________________________ > Mailing list: https://launchpad.net/~dhis2-devs > Post to : dhis2-devs@lists.launchpad.net > Unsubscribe : https://launchpad.net/~dhis2-devs > More help : https://help.launchpad.net/ListHelp > _______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp