What directory is script in??? Bad description

From: Billy Patton (bpatton_at_ti.com)
Date: 04/28/05


Date: Thu, 28 Apr 2005 13:50:03 -0500

Here is a small script

#!/bin/bash
if [ $# == 0 ] ; then
   pod2text $0;
   exit 1;
fi;

if [ $1 == '-h' ] ; then
   pod2text $0;
   exit 1;
fi;

platform=`uname`;
if [ `/bin/uname -s` = 'Linux' ] ; then
   if [ `/bin/uname -m` = 'x86_64' ] ; then bit=64;
   else bit=32;
   fi;
elif [ `/bin/uname -s` = 'SunOS' ] ; then
    if [ `/bin/isainfo -b` = 64 ] ; then bit=64;
    else bit=32;
    fi;
fi

$CDMG_TOOLBOX/bin/$platform/$bit/LaffAdd $*
exit $?;

<<<<

The above script access the correct executable based on platform (Linux/SunOS)
and the bits (32/64)
Notice the $CDMG_TOOLBOX. There is a file that needs to be source'd before
executing the above script.
Question.
What can I replace $CDMG_TOOLBOX with to get it to recognize the physical
directory the script is stored in. I'm thinking that this should be easy.

    ___ _ ____ ___ __ __
   / _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
  / _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
            /___/
Texas Instruments ASIC Circuit Design Methodology Group
Dallas, Texas, 214-480-4455, b-patton@ti.com



Relevant Pages

  • Re: Is This a KDE/Gnome Group?
    ... GUI offers means to present information in various structured ways. ... I've never encountered that in a shell script, ... The devolper only needs hints about the places, where his code might use an platform specific API, so that he can provide workarounds for those platforms, which do not provide the required functionality. ... The more common libraries, the less library installations. ...
    (comp.os.linux.setup)
  • Re: Is there a strategy for multiplatform builds and distributions?
    ... >> The build processes work, but they are a nuisance to set up. ... > contains compiler flags etc specific to that system, and as the name of a ... > between platforms, I just rerun the configure script on the new platform ...
    (comp.lang.fortran)
  • Re: Using more than one printer?
    ... > your version and you platform. ... > Pre-7 filemaker remembers the settings you made. ... > command enter the line Print Setup. ... Now perform your script ...
    (comp.databases.filemaker)
  • Re: sqlplus and here document
    ... Chuck wrote: ... As you can see by my reply to Robert, it was the trailing space after ... Absolutely certain it was the script I was testing. ... Platform is Oracle 9.2 on Solaris 9. ...
    (comp.databases.oracle.server)
  • Re: Launch a background task from a PHP script?
    ... According to the PHP Manual, the function register_shutdown_functionwas the solution "in PHP 4.0.6 and earlier under Apache", but "since PHP 4.1 the shutdown functions are called as the part of the request" so that PHP waits until the shutdown functions are completed before closing the connection to the user. ... echo 'Starting main script... ... Not sere how you would accomplish this on the Windows platform, but then again if you are doing anything serious, Windows is not your server platform. ...
    (comp.lang.php)