05-11-2006
Is there such thing as Global Env Variable for all users?
Hello
im using SunOS and its great , I know I can setenv global environment variable per user
but my question is can I setenv global environment variable in more higher level ( maybe some kind of root user or something) so that every users will
see the same value of this global env
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi,
i am a newbie unix administrator. i want to set a variable, let's say :
alias cls 'clear'
But i am not going to add this line in the .login file for every home directory of my 500+ users.
pls tell me where should i put this line in, so that all users can use this variable after... (4 Replies)
Discussion started by: champion
4 Replies
2. UNIX for Advanced & Expert Users
Hello,
I am interested in your strategy for handling engineers Unix accounts when the engineers must log in to resources in a variety of locals in a global environment. The engineers home directory and normal environment is local to where the engineer is sitting. When they log in to a remote... (0 Replies)
Discussion started by: Randal
0 Replies
3. Solaris
Hello,
I'm working on a Solaris 9 machine. I found the root's environment variables (say, $PATH, $ORACLE_HOME, big problem) were set differently from the users'. All regular users use C shell now and share the same environment file stored in /usr/local/config/cshrc.default.
Should I just use... (4 Replies)
Discussion started by: alanlh
4 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have a doubt on Environment variable.
I want to know where and when the envirnment variables are defined?
Thanks & Regards,
Siba (1 Reply)
Discussion started by: siba.s.nayak
1 Replies
5. Shell Programming and Scripting
Question 1: If I set ENV=$HOME/myenvprofile.ksh, will my script get executed when ever I login to my with KSH. My doubt is we used to put this in .profile of our home directory. SO when ever I login will it executed?
QUestion 2: If I set ENV=`echo "hi"` or 'echo "hi" ', what would be the output.... (0 Replies)
Discussion started by: ramkrix
0 Replies
6. UNIX for Dummies Questions & Answers
Greetings:
I need to remove 'RUBYOPT' env variable to install MacRuby. I see it via $env (tchrc).
I checked my (local) .tcshrc, .login, .profile files: not defined there. Apparently, it's not set locally. I know this RUBYOPT is global, since I can see it in another account on my... (4 Replies)
Discussion started by: UncleRic
4 Replies
7. Solaris
Hi Guys,
My requirement is I have file called /opt/orahome/.profile in non global zone.
PATH=/usr/bin:/usr/ucb:/etc:/usr/sbin:/usr/local/bin:/usr/openwin/bin:.
export PATH
PS1="\${ORACLE_SID}:`hostname`:\$PWD$ "
export PS1
EDITOR=vi
export EDITOR
ENV=/opt/orahome/.kshrc
export ENV... (1 Reply)
Discussion started by: vijaysachin
1 Replies
8. Shell Programming and Scripting
Hello,
I want to cange env variable on SunOS.
I tried:
export GONGA=$GONGA:/users/BANK1/basic/queues/SARON_SPACE1
it changed it only localy for my session.
when i opened a new session (telnet etc') the old value exist.
How can I change it to effact all sessions.
Thanks. (2 Replies)
Discussion started by: LiorAmitai
2 Replies
9. Web Development
(Above from Apache docs).
On my system, using:
SetEnvIf User-Agent Mozilla IsBad=1
Order allow,deny
Allow from all
Deny from env=IsBad ...I see that environment variable is set (using phpinfo()) but the page is still served. No errors in the Apache logs. (1 Reply)
Discussion started by: gnurob
1 Replies
10. Shell Programming and Scripting
Hi All,
I have a requirement where I have a config file, which contains 2 coulmn.values of first column are environmnet variable, whose value is defined in an environment file.
In my script I need to read the config file, and get the value of the config file variable from env file.
I... (2 Replies)
Discussion started by: alok2082
2 Replies
LEARN ABOUT MOJAVE
setenv
GETENV(3) BSD Library Functions Manual GETENV(3)
NAME
getenv, putenv, setenv, unsetenv -- environment variable functions
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdlib.h>
char *
getenv(const char *name);
int
setenv(const char *name, const char *value, int overwrite);
int
putenv(char *string);
int
unsetenv(const char *name);
DESCRIPTION
These functions set, unset and fetch environment variables from the host environment list.
The getenv() function obtains the current value of the environment variable, name. The application should not modify the string pointed to
by the getenv() function.
The setenv() function inserts or resets the environment variable name in the current environment list. If the variable name does not exist
in the list, it is inserted with the given value. If the variable does exist, the argument overwrite is tested; if overwrite is zero, the
variable is not reset, otherwise it is reset to the given value.
The putenv() function takes an argument of the form ``name=value'' and is equivalent to:
setenv(name, value, 1);
The string pointed to by string becomes part of the environment. A program should not alter or free the string, and should not use stack or
other transient string variables as arguments to putenv(). The setenv() function is strongly preferred to putenv().
The unsetenv() function deletes all instances of the variable name pointed to by name from the list. Note that only the variable name (e.g.,
"NAME") should be given; "NAME=value" will not work.
RETURN VALUES
The getenv() function returns the value of the environment variable as a NUL-terminated string. If the variable name is not in the current
environment, NULL is returned.
The setenv(), putenv(), and unsetenv() functions return the value 0 if successful; otherwise the value -1 is returned and the global variable
errno is set to indicate the error.
ERRORS
[EINVAL] The function getenv(), setenv() or unsetenv() failed because the name is a NULL pointer, points to an empty string, or
points to a string containing an ``='' character.
The function putenv() failed because string is a NULL pointer or string is without an ``='' character.
[ENOMEM] The function setenv(), unsetenv() or putenv() failed because it was unable to allocate memory for the environment.
LEGACY SYNOPSIS
#include <stdlib.h>
void
unsetenv(const char *name);
unsetenv() doesn't return a value.
COMPATIBILITY
putenv() no longer copies its input buffer. This often appears in crash logs as a crash in getenv(). Avoid passing local buffers or freeing
the memory that is passed to putenv(). Use setenv(), which still makes an internal copy of its buffers.
unsetenv() no longer parses the variable name; e.g., unsetenv ("FOO=BAR") no longer works. Use unsetenv("FOO"). unsetenv() also now returns
a status value and will set errno to EINVAL if name is not a defined environment variable.
SEE ALSO
csh(1), sh(1), execve(2), compat(5), environ(7)
STANDARDS
The getenv() function conforms to ISO/IEC 9899:1990 (``ISO C90''). The setenv(), putenv() and unsetenv() functions conforms to IEEE Std
1003.1-2001 (``POSIX.1'').
HISTORY
The functions setenv() and unsetenv() appeared in Version 7 AT&T UNIX. The putenv() function appeared in 4.3BSD-Reno.
BUGS
Successive calls to setenv() that assign a larger-sized value than any previous value to the same name will result in a memory leak. The
FreeBSD semantics for this function (namely, that the contents of value are copied and that old values remain accessible indefinitely) make
this bug unavoidable. Future versions may eliminate one or both of these semantic guarantees in order to fix the bug.
BSD
June 20, 2007 BSD