scripting expert ?

John Gay johngay at eircom.net
Thu Jul 24 08:17:47 PDT 2003


I'm trying to play around with Houdini, but I'm having problems loading the 
profile provided. As I don't know the first thing about bash scripting, I 
don't quite understand where it's going wrong. The error I get is:

johngay at debian:/opt/hfs6$ source houdini_setup_bash
bash: [: !=: unary operator expected

but I can't figure out where this line is coming from. I am guessing that 
something is not getting set properly. Here is the actual script:

#
#   Environment setup script for Houdini.
#
#   To use this script you should "cd" to the hfs directory where this
#   script is located and "source" it into your bash shell or from your
#   .profile script.
#
#   Alternatively you may copy this script, remove the first if
#   statement and change the setting of the "HFS" variable to be
#   the location of your installed Houdini hfs directory.
#
#   Note that this script modifies your search path by inserting the
#   Houdini bin directory at the beginning. It also explicitly sets
#   the IRIX environment variable LD_LIBRARY_PATH which is used to
#   search for runtime libraries (see the IRIX man page rld(1) for
#   more information on this).
#
#   To run the script in quiet mode, specify the "-q" option on the
#   command line.
#
if [ ! -d houdini  -o  ! -d dsolib  -o  ! -d bin ]; then
    echo "You must cd to the Houdini installation directory before"
    echo "sourcing this script. This allows the script to determine"
    echo "the installed location."
else
    HFS=$PWD
    export HFS

    #
    #  The following are some handy shortcuts:
    #
    H=${HFS}
    HB=${H}/bin
    HDSO=${H}/dsolib
    HD=${H}/demo
    HH=${H}/houdini
    HHC=${HH}/config
    HT=${H}/toolkit
    HSB=${HH}/sbin
    HTB=${HT}/bin

    #
    #  The following is used as the generic /tmp path.  This is also
    # set on Windows to the temporary directory, so can be used for
    # system independent .hip files.
    #
    TEMP=/tmp
    export TEMP

    #
    # These environment variables are no longer supported.
    #
    HIH=${HOME}/houdini6
    # HIL=${HSITE}/houdini6
    HIS=$HH


    #
    #  Turn off any local character translation before looking at the
    #  output of the file command...
    #
    save_lang=""
    if [ "$LANG" != "" ]; then
        if [ "$LANG" != "C" ]; then
            set save_lang="$LANG"
            LANG="C"
        fi
    fi

    if [ `file $HDSO/libHoudiniUT.so | cut -d ' ' -f 2` = "N32" ]; then
        if [ "$LD_LIBRARYN32_PATH" != "" ]; then
            LD_LIBRARYN32_PATH="${HDSO}:${LD_LIBRARYN32_PATH}"
        else
            LD_LIBRARYN32_PATH="${HDSO}:/usr/lib32:/lib32"
        fi
        export LD_LIBRARYN32_PATH
    else
        if [ "$LD_LIBRARY_PATH" != "" ]; then
            LD_LIBRARY_PATH="${HDSO}:${LD_LIBRARY_PATH}"
        else
            LD_LIBRARY_PATH="${HDSO}:/usr/lib:/lib"
        fi
        export LD_LIBRARY_PATH
    fi
    PATH="${HB}:${HSB}:$PATH"
    export PATH

    #
    # HDK customers should replace the above line with this one:
    #
    # PATH="${HB}:${HSB}:${HTB}:$path"

    if [ "$save_lang" != "" ]; then
        LANG="$save_lang";
        unset save_lang
    fi

    HOUDINI_MAJOR_RELEASE=6
    HOUDINI_MINOR_RELEASE=0
    HOUDINI_BUILD_VERSION=286
    
HOUDINI_VERSION=${HOUDINI_MAJOR_RELEASE}.${HOUDINI_MINOR_RELEASE}.${HOUDINI_BUILD_VERSION}

    if [ $?prompt ]; then
        if [ $1 != "-q" ]; then
            echo "The Houdini ${HOUDINI_VERSION} environment has been 
initialized."
        fi
    fi
fi

And my environment is:

johngay at debian:~$ env
KDE_MULTIHEAD=false
SSH_AGENT_PID=457
TERM=xterm
SHELL=/bin/bash
GTK_RC_FILES=/etc/gtk/gtkrc:/home/johngay/.gtkrc:/home/johngay/.gtkrc-kde
GS_LIB=/home/johngay/.kde/share/fonts
OLDPWD=/opt/hfs6
USER=johngay
LD_LIBRARY_PATH=/opt/hfs6/dsolib:/opt/hfs6/dsolib:/usr/lib:/lib
TEMP=/tmp
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:
SSH_AUTH_SOCK=/tmp/ssh-XXSYrUWo/agent.432
SESSION_MANAGER=local/debian:/tmp/.ICE-unix/504
USERNAME=johngay
KONSOLE_DCOP=DCOPRef(konsole-514,konsole)
PATH=/opt/hfs6/bin:/opt/hfs6/houdini/sbin:/opt/hfs6/bin:/opt/hfs6/houdini/sbin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
KONSOLE_DCOP_SESSION=DCOPRef(konsole-514,session-1)
PWD=/home/johngay
LANG=C
GDM_LANG=C
HFS=/opt/hfs6
GDMSESSION=Debian
SHLVL=2
HOME=/home/johngay
LOGNAME=johngay
DISPLAY=:0
COLORTERM=
XAUTHORITY=/tmp/.gdmSLsYZo
_=/usr/bin/env


The strange thing is, some of it gets set, but I never get the final "The 
Houdini ${HOUDINI_VERSION} environment has been initialized."
message. I can run the program, but it quits without explaination when I try 
to press any button on the display. But that is another issue I'll deal with 
later.

Seems my fortune .sig is getting psychic on me (-:

Cheers,

	John Gay

-- 
"I can explain it for you, but I can't understand it for you."

 -- Unknown.

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-chat' in the subject header of the message



More information about the lfs-chat mailing list