Sponsored Content
Top Forums Shell Programming and Scripting Trying to do a bit of automation... but nooooo. Post 302421867 by KruesephiikZ` on Sunday 16th of May 2010 11:24:08 PM
Old 05-17-2010
Trying to do a bit of automation... but nooooo.

Epic stupid.. I forgot the `pwd` and trailing /, disregard this. Leaving the text up for a good laugh.



Maybe I'm just wicked tired, or I'm totally stupid. But I can't see where the problem is. I keep getting an unexpected operator at line 44, and if I remove said operator, I get another message. So here goes... halp?

Error before removing line 44:
Code:
kruesephiikz@kaos:~$ sh winebuild
Archive found. [ /home/kruesephiikz/wine-1.1.44.tar.bz2 ] correct? [ Y/N ]
y
Archive correct, move along.
[: 44: wine-1.1.44: unexpected operator
Something went wrong. Check error.

Error after removing line 44:
Code:
kruesephiikz@kaos:~$ sh winebuild
Archive found. [ /home/kruesephiikz/wine-1.1.44.tar.bz2 ] correct? [ Y/N ]
y
Archive correct, move along.
winebuild: 104: Syntax error: end of file unexpected (expecting "fi")

Line 44 content:
Code:
 fi

Sript:

Code:
#!/bin/sh
if [ -f `pwd`/wine*.tar.bz2 ]
then 
    echo Archive found. [ `pwd`/wine-*.bz2 ] correct? [ Y/N ]
        read yn1
            case $yn1
                in
                    "y")    echo "Archive correct, move along."
                        sleep 2
                        break;;
                        
                    "n") echo "Archive incorrect, kill script."
                        exit;;
            esac
else
    echo Archive not found... abort
    exit
fi

if [ -d wine-* ]
then
    echo Previous directory found, remove? [ Y/N ]
    read yn2
        case $yn2
            in
                "y") echo "Deleting old directory."
                    rm -r `pwd`/wine-*/
                    echo "Extracting Wine archive."
                    sleep 2
                    tar -xvf `pwd`/wine-*.tar.bz2
                    break;;
                "n") echo "Cannot delete, exit."
                    exit;;
        esac
else 
        if [ $? -ne 0 ]
        then
            echo Something went wrong. Check error.
            exit
        fi
    echo Directory not found, continuing to extract.
    sleep 2
    tar -xvf `pwd`/wine-*.tar.bz2
fi

echo Compile starting, change directory.
sleep 2
cd wine-*

echo Create symlinks? [ Ubuntu-64 Users Only ] [ Y/N ]
read yn3
    case $yn3
        in 
            "y") echo "Creating Symlinks, please wait."
                sleep 2
                    mkdir -p `pwd`/lib32
                    ln -s /usr/lib32/libX11.so.6 `pwd`/lib32/libX11.so
                    ln -s /usr/lib32/libXext.so.6 `pwd`/lib32/libXext.so
                    ln -s /usr/lib32/libfreetype.so.6 `pwd`/lib32/libfreetype.so
                    ln -s /usr/lib32/libfontconfig.so.1 `pwd`/lib32/libfontconfig.so
                    ln -s /usr/lib32/libGL.so.1 `pwd`/lib32/libGL.so
                    ln -s /usr/lib32/libGLU.so.1 `pwd`/lib32/libGLU.so
                    ln -s /usr/lib32/libXrender.so.1 `pwd`/lib32/libXrender.so
                    ln -s /usr/lib32/libXinerama.so.1 `pwd`/lib32/libXinerama.so
                    ln -s /usr/lib32/libXxf86vm.so.1 `pwd`/lib32/libXxf86vm.so
                    ln -s /usr/lib32/libXi.so.6 `pwd`/lib32/libXi.so
                    ln -s /usr/lib32/libXrandr.so.2 `pwd`/lib32/libXrandr.so
                    ln -s /usr/lib32/liblcms.so.1 `pwd`/lib32/liblcms.so
                    ln -s /usr/lib32/libpng12.so.0 `pwd`/lib32/libpng.so
                    ln -s /usr/lib32/libcrypto.so.0.9.8 `pwd`/lib32/libcrypto.so
                    ln -s /usr/lib32/libssl.so.0.9.8 `pwd`/lib32/libssl.so
                    ln -s /usr/lib32/libxml2.so.2 `pwd`/lib32/libxml2.so
                    ln -s /usr/lib32/libjpeg.so.62 `pwd`/lib32/libjpeg.so
                    ln -s /usr/lib32/libXcomposite.so.1 `pwd`/lib32/libXcomposite.so
                    ln -s /usr/lib32/libcups.so.2 `pwd`/lib32/libcups.so
                    ln -s /usr/lib32/libXcursor.so.1 `pwd`/lib32/libXcursor.so
                    ln -s /lib32/libdbus-1.so.3 `pwd`/lib32/libdbus-1.so
                    ln -s /usr/lib32/libhal.so.1 `pwd`/lib32/libhal.so
                    ln -s /usr/lib32/libsane.so.1 `pwd`/lib32/libsane.so
                    ln -s /usr/lib32/libgphoto2.so.2 `pwd`/lib32/libgphoto2.so
                    ln -s /usr/lib32/libgphoto2_port.so.0 `pwd`/lib32/libgphoto2_port.so
                    ln -s /usr/lib32/libldap-2.4.so.2 `pwd`/lib32/libldap.so
                    ln -s /usr/lib32/libldap_r-2.4.so.2 `pwd`/lib32/libldap_r.so
                    ln -s /usr/lib32/liblber-2.4.so.2 `pwd`/lib32/liblber.so
                    ln -s /usr/lib32/libxslt.so.1 `pwd`/lib32/libxslt.so
                    ln -s /usr/lib32/libcapi20.so.3 `pwd`/lib32/libcapi20.so
                    ln -s /usr/lib32/libjack.so.0 `pwd`/lib32/libjack.so
                    ln -s /usr/lib32/libodbc.so.1 `pwd`/lib32/libodbc.so
                    ln -s /usr/lib32/libgnutls.so.26 `pwd`/lib32/libgnutls.so
                    echo "Symlinks created."
                    sleep 2
                break;;
            "n")  echo "Hopefully a non 64-bit user. If you are on 64-bit Ubuntu, CTRL-C Now and restart."
                sleep 1
                break;;
    esac

echo Compiling now! 
sleep 2
CC="gcc-4.4 -m32" LDFLAGS="-L/lib32 -L/usr/lib32 -L`pwd`/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,/usr/lib32" ./configure -v
make -j5 -s depend
make -j5 -s
wineserver -k
sudo make -j5 install

Thanks a ton for taking a look. Smilie

Believe it or not, the script works like a charm if the directory isn't found. If it is, however, this is the error I receive.

Last edited by KruesephiikZ`; 05-17-2010 at 12:36 AM..
 

4 More Discussions You Might Find Interesting

1. Programming

copying or concatinating string from 1st bit, leaving 0th bit

Hello, If i have 2 strings str1 and str2, i would like to copy/concatenate str2 to str1, from 1st bit leaving the 0th bit. How do i do it? (2 Replies)
Discussion started by: jazz
2 Replies

2. Red Hat

boot the 32 bit kernel on a 64 bit PPC Linux machine?

Hi all, I'm looking to cover a corner case for an upcoming test cycle. Is there a way to boot a RedHat Advanced Server 4 (update 3) installed on a Power PC machine to use a 32 bit kernel? This would be similar to what is done here -> https://www.unix.com/aix/26204-aix-platform.html I've done... (0 Replies)
Discussion started by: philrau
0 Replies

3. Shell Programming and Scripting

How to handle 64 bit arithmetic operation at 32 bit compiled perl interpreter?H

Hi, Here is the issue. From the program snippet I have Base: 0x1800000000, Size: 0x3FFE7FFFFFFFF which are of 40 and 56 bits. SO I used use bignum to do the math but summing them up I always failed having correct result. perl interpreter info, perl, v5.8.8 built for... (0 Replies)
Discussion started by: rrd1986
0 Replies

4. Windows & DOS: Issues & Discussions

Which version of Windows Vista to install with a product key? 32-bit or 64-bit?

Hello everyone. I bought a dell laptop (XPS M1330) online which came without a hard drive. There is a Windows Vista Ultimate OEMAct sticker with product key at the bottom case. I checked dell website (here) for this model and it says this model supports both 32 and 64-bit version of Windows... (4 Replies)
Discussion started by: milhan
4 Replies
All times are GMT -4. The time now is 02:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy