Hi Viraj,
It looks to me like your clearing the value of $SHLIB_PATH (unset
SHLIB_PATH) then using $SHLIB_PATH to set the value of SHLIB_PATH. Since
it is empty to begin with the value will be null. In a shell script if you
run it from a user's current shell (in your case by executing tst) the
script picks up your current environment (therefore SHLIB_PATH is whatever
initial value is set from the user's .profile). But if you run . tst the
script gets it's environment from the script itself with all variables set
to null until initialized. You must make $SHLIB_PATH equal to some value
within the script before it can be used.
HTH,
Rocky
- Viraj Luthra <viraj999_at_lycos.com> wrote:
> Hello all,
>
> Ihave the following script, called as tst. When the script is executed
> as,
>
> tst, then every thing is okay, but when it is executed as . tst, then I
> get the error:-
>
> sh: SHLIB_PATH: Parameter not set.
>
> I need to use the following format that is
> . .profile, as in above case as . tst
>
> The reason why I am doing above is because the SHLIB_PATH is not set
> properly, I get heaps of problems. If the SHLIB_PATH is not set, I just
> want to set it to say $HOME.
>
> Please reply as this is urgent.
>
> Thanks and Regards,
>
> Raja
>
> ======================================
>
> The script follows:-
>
> #!/bin/sh
> #
> echo
> echo
> echo Start Test
> echo
> echo uname -a = `uname -a`
> echo First check what happens if you try and set SHLIB_PATH
> echo and there is no initial setting
> unset SHLIB_PATH
> echo First what is its value?
> echo SHLIB_PATH = $SHLIB_PATH
> echo Now lets set it to default:123
> SHLIB_PATH="$SHLIB_PATH:123"
> echo OK what is the value now?
> echo SHLIB_PATH = $SHLIB_PATH
> echo
> echo Now lets reset the value to nothing
> unset SHLIB_PATH
> echo Check value
> echo SHLIB_PATH = $SHLIB_PATH
> echo Now do what is in our script....
> if [ -z "${SHLIB_PATH}" ]; then
> echo It has no current default value
> SHLIB_PATH="${HOME}"
> else
> echo It has a default path of $SHLIB_PATH
> SHLIB_PATH="${HOME}:${SHLIB_PATH}"
> fi
> echo So what is our final result?
> echo SHLIB_PATH = $SHLIB_PATH
>
>
>
> Get 250 color business cards for FREE!
> http://businesscards.lycos.com/vp/fastpath/
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Viraj Luthra
> INET: viraj999_at_lycos.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Rocky Welch
INET: rockyw_99_at_yahoo.com
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Thu Apr 26 2001 - 10:43:34 CDT