08-20-2009
Hi Jim, first of all..Thanx for the reply....
The code i am using has to link with shared libraries only. and other thing is that it is using set-uid. I read that when set-uid is used, the binary will ignore LD_LIBRARY_PATH and will look into only standard paths like /usr/lib. One option i am left with is to provide runtime path while compiling. Is there any other option... Please specify
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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)
Discussion started by: ParNone
2 Replies
2. UNIX for Dummies Questions & Answers
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)
Discussion started by: FredSmith
1 Replies
3. Programming
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)
Discussion started by: pgarg
3 Replies
4. Shell Programming and Scripting
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)
Discussion started by: zeus101
2 Replies
5. Shell Programming and Scripting
How to export variable from one script to other?
Can anybody give me syntax for that?
Thanks (2 Replies)
Discussion started by: navi
2 Replies
6. Shell Programming and Scripting
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)
Discussion started by: arex876
5 Replies
7. Shell Programming and Scripting
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)
Discussion started by: ken002
5 Replies
8. Shell Programming and Scripting
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)
Discussion started by: newbie2010
7 Replies
9. UNIX for Advanced & Expert Users
Hi,
Please find my code below.
ps -xef | grep 14766 | awk 'BEGIN{X="java_home=";X="weblogic_home="}
{for(i=1;i<=NF;i++){if($i ~ /-Dplatform\.home|java$/){split($i,P,"=");s=P?P:$i;print X""s}}}'
echo "java_home="$java_home
echo "weblogic_home="$weblogic_home
Output:
Why does... (3 Replies)
Discussion started by: mohtashims
3 Replies
10. Shell Programming and Scripting
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)
Discussion started by: baris35
3 Replies
LEARN ABOUT OPENSOLARIS
putenv
putenv(3C) Standard C Library Functions putenv(3C)
NAME
putenv - change or add value to environment
SYNOPSIS
#include <stdlib.h>
int putenv(char *string);
DESCRIPTION
The putenv() function makes the value of the environment variable name equal to value by altering an existing variable or creating a new
one. In either case, the string pointed to by string becomes part of the environment, so altering the string will change the environment.
The string argument points to a string of the form name=value. The space used by string is no longer used once a new string-defining name
is passed to putenv().
The putenv() function uses malloc(3C) to enlarge the environment.
After putenv() is called, environment variables are not in alphabetical order.
RETURN VALUES
Upon successful completion, putenv() returns 0. Otherwise, it returns a non-zero value and sets errno to indicate the error.
ERRORS
The putenv() function may fail if:
ENOMEM Insufficient memory was available.
USAGE
The putenv() function can be safely called from multithreaded programs. Caution must be exercised when using this function and getenv(3C)
in multithreaded programs. These functions examine and modify the environment list, which is shared by all threads in a program. The sys-
tem prevents the list from being accessed simultaneously by two different threads. It does not, however, prevent two threads from succes-
sively accessing the environment list using putenv() or getenv().
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO
exec(2), getenv(3C), malloc(3C), attributes(5), environ(5), standards(5)
WARNINGS
The string argument should not be an automatic variable. It should be declared static if it is declared within a function because it can-
not be automatically declared. A potential error is to call putenv() with a pointer to an automatic variable as the argument and to then
exit the calling function while string is still part of the environment.
SunOS 5.11 7 Aug 2004 putenv(3C)