05-11-2006
Environments are local, per user, not global.
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 NETBSD
getenv_r
GETENV(3) BSD Library Functions Manual GETENV(3)
NAME
getenv, getenv_r, putenv, setenv, unsetenv -- environment variable functions
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdlib.h>
char *
getenv(const char *name);
int
getenv_r(const char *name, char *buf, size_t len);
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. For compatibility with differing environment con-
ventions, the getenv() or getenv_r() given argument name may be appended with an equal sign ``=''.
The getenv() function obtains the current value of the environment variable name. If the variable name is not in the current environment, a
NULL pointer is returned.
The getenv_r() function obtains the current value of the environment variable name and copies it to buf. If name is not in the current envi-
ronment, or the string length of the value of name is longer than len characters, then -1 is returned and errno is set to indicate the error.
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 it will set the environment variable ``name'' equal to ``value'' by
altering an existing entry, or creating a new one if an existing one does not exist. The actual string argument passed to putenv() will
become part of the environment. If one changes the string, the environment will also change.
The unsetenv() function deletes all instances of the variable name pointed to by name from the list.
RETURN VALUES
The functions getenv_r(), setenv(), putenv(), and unsetenv() return zero if successful; otherwise the global variable errno is set to indi-
cate the error and a -1 is returned.
If getenv() is successful, the string returned should be considered read-only.
ERRORS
[EINVAL] The name argument to setenv() or unsetenv() is a null pointer, points to an empty string, or points to a string containing
an ``='' character. The value argument to setenv() is a null pointer. The string argument to putenv() is a null pointer,
or points to a string that either starts with a ``='' character or does not contain one at all.
[ENOMEM] The function setenv() or putenv() failed because they were unable to allocate memory for the environment.
The function getenv_r() can return the following errors:
[ENOENT] The variable name was not found in the environment.
[ERANGE] The value of the named variable is too long to fit in the supplied buffer.
SEE ALSO
csh(1), sh(1), execve(2), environ(7)
STANDARDS
The getenv() function conforms to ANSI X3.159-1989 (``ANSI C89''). The putenv() function conforms to X/Open Portability Guide Issue 4
(``XPG4''). The unsetenv() function 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.
BSD
October 25, 2010 BSD