LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to install program with .sh file in ubuntu? (http://www.linuxquestions.org/questions/linux-software-2/how-to-install-program-with-sh-file-in-ubuntu-563997/)

izquierdista 06-23-2007 02:14 PM

How to install program with .sh file in ubuntu?
 
Hello, I would like to install a small application called DHW page viewer on a computer that runs Ubuntu Feisty Fawn.

I think this program was written for KDE because whenver I used to have SUSE the program would install very easily. But now I switched over to Ubuntu and when I try to double click on the file and install the program I get error messages inside a text editor.

How do I go about installing this program, is there anyway I can install the necessary components?

I really need this to work.

mdg 06-23-2007 02:28 PM

You can install a shell script by doing "sh filename.sh" in terminal

izquierdista 06-23-2007 02:35 PM

I get this error message whenever I try to run that command:

Code:

chacmool@link:~$ sh DHWPageViewer.sh
DHWPageViewer.sh: 2: Syntax error: "(" unexpected
chacmool@link:~$

what should I do now?

btmiller 06-23-2007 02:37 PM

Can you post the first 5 lines of the script? It looks like there's an error in the shell script code. This has nothing to do with GNOME or KDE BTW.

izquierdista 06-23-2007 03:10 PM

Ok,
whenever I double click on the .sh file this is what I get:

Code:

#!/bin/sh
function error()
{
        kdialog --error "$1" --title "Could not install Digital Handwriting Page Viewer"
        exit 1
}

if [ -z `which uudecode` ]
then
        error "You must have uudecode installed to run this installer."
fi

if [ -z `which tar` ]
then
        error "You must have tar installed to run this installer."
fi

if [ -z `which bzcat` ]
then
        error "You must have bzcat installed to run this installer."
fi

INSTALL=`kdialog --getexistingdirectory $PWD`
if [ -z $INSTALL ]
then
        error "You must specify an install directory that already exists."
fi

if [ `which kde-config` ]
then

#DESKTOP=`kde-config --expandvars --install xdgdata-apps`
DESKTOP="`kde-config --localprefix`/share/applnk"
mkdir -p $DESKTOP
touch $DESKTOP/DHWPageViewer.desktop || error "Could not create menu entry."
( cat > $DESKTOP/DHWPageViewer.desktop ) << DESKTOP_END
[Desktop Entry]
Encoding=UTF-8
Type=Application
Exec=/bin/sh $INSTALL/DHWPageViewer2.0/wrapper
Icon=$INSTALL/DHWPageViewer2.0/icon.png
Name=Digital Handwriting Page Viewer
Categories=Qt;KDE;Graphics
DESKTOP_END
kbuildsycoca --menutest &> /dev/null
fi

mkdir -p $INSTALL || error "Could not write to install directory."
cd $INSTALL
(uudecode -o /dev/stdout | bzcat -c | tar -xv ) << ENDOFWRAPPER
begin-base64 644 encoded.dat

I know for a fact the program works because whenever I had SUSE as I said I could install it using the .sh file without any problems

nerdroger 01-07-2008 06:20 PM

I need this file...
 
Is there any possible way that you could post the DHWPageViewer.sh file? I have been searching the internet and the original link is dead.

Thanks
Roger

alfanerd 02-06-2008 06:30 PM

Try bash
 
Try using bash instead of sh

bash DHWPageViewer.sh

Most likely in your system sh is linked to dash instead of bash.

Good luck

jay73 02-06-2008 07:00 PM

Do chmod +x filename, then ./filename.


All times are GMT -5. The time now is 08:11 PM.