Let me understand. You call putenv() inside a program that relies on LD_LIBRARY_PATH?
You do know that dld() opens the runtime libraries BEFORE your putenv() code is called?
How else could it access the external code for putenv? putenv is linked as a symbol reference that has to be dereferenced at runtime.
So. Part of exectuable image activation is opening the runtime libraries. Do you have truss or strace or trace on your machine? If so, run your code under it. Note that before the executable runs the stuff you wrote it does a lot of file mapping and file opening. Most of that is shared libraries.
One way -
Instead of all this pain, statically link your exectuable against the library that now requiresLD_LIBRARY_PATH. Usually this means supplying the name of the .a form of the library on the command line (or makefile)
Now, you do not need LD_LIBRARY_PATH in order to use liboddlibrary
I'm having an issue when I export within my program. I'm getting the variable name, not the variable value. I have a configuration file (config.txt) that has the values of the variables set as so:
set -a
export ARCHIVEPOSourceDir="/interfaces/po/log /interfaces/po/data"
export... (2 Replies)
I'm trying to open an xwindow on my Sun server. What am I doing wrong?
# echo $SHELL
/sbin/sh
#
# export DISPLAY=localhost:0.0
DISPLAY=localhost:0.0: is not an identifier
Thank you! (1 Reply)
Hi, I m trying to change the env variable from the c program which inturn calls another c executable. i m using the putenv function but it does not set the value as required , it overwrites the values with some other values...
i m using following cmd's to set the env variable FULL_PATH :
... (3 Replies)
Hi Guys,
I am using the korn shell. I have an environments files where I have defined a variable
export START_TIME=060000
export END_TIME=220000
I source this environments file into one of my scripts.
The problem is that when I try to use this variable, I cannot get to use this variable as a... (2 Replies)
Hi
I have a pass a variable from one script to another.
Here are my scripts
Script #1 ./profile
#!/bin/sh
export NAME="Hello"
Script #2 ./test
#!/bin/sh
./profile
echo $NAME
when I run ./test .. i am not getting anything .. why is that? (5 Replies)
Hi, Unix Gurus,
I have a problem need help. I have a script to generate environment variable code same as following:
oracle_sid=abcd
export oracle_sid
when I execute this code with command ./script_nane it succeeded.
when I try to find it with env command or echo $oracle_sid, it does not show... (5 Replies)
I am relatively new to exporting variables, and I just can't seem to make this count work. What I have is the following:
TOTAL=$($IMAGELIST -backupid $IM -U |gawk '{print $5}' |tail -1)|gawk '{print $6}'
RESTORED=$($BPDBJOBS -most_columns -jobid $JOBS |cut -f15 -d,) |gawk '{print $6}'
export... (7 Replies)
Hello,
Please see the script found in my computer below. (Ubuntu 14.04)
#!/bin/sh
export APP_DIR="/home/appname"
monitorscript="$APP_DIR""/monitor.sh"
ps cax | grep monitor.sh > /dev/null
if ; then
echo "monitor.sh is running"
else
"$monitorscript"
fi
My question is regarding EXPORT... (3 Replies)