You did not say what version of HP-UX you are working on...
Till 11.23 ( after I dont know...) the default user shell was ksh , so you would use either .profile or .kshrc in your home directory, for root user its a little different...
I will add to previous post that you can in .kshrc and even in .profile now ( since 11.00 ? ) use also this syntax:
Well first of all I am a real Unix newbie. I am taking a course on it in University. I kind of understand set and setenv but, I think it si something that I should really understand. So I thought that I would try a forum out and see how good you guys really are.
The question:
Execute the... (1 Reply)
I never undestood exactly what's the difference between the SET and SETENV commands.
One sets variables visible to all users and the other (SETENV) only to the specific user environment ?
Thanks in advance,
BraZil - thE heLL iS HEre :mad: !!! (2 Replies)
I thought that set and setenv was easy enough to understand until I started experimenting.
I noticed the same problem in a previous thread, so I will use it as an example.
set command gave the following output:
argv ()
cwd /homes/e/ee325328/assignment.2
home /homes/e/ee325328
path ( a... (2 Replies)
Hi All,
I use "export DISPLAY=same_host:0.0" to set my export DISPLAY and it is working fine for me..
Problem here is I have developed a script for which i should run export DISPLAY prior to running my script....
so my script should check whether export DISPLAY is set or not.. if... (6 Replies)
Does know where I can find what ALL of the set options do in vi? I can't find it anywhere in vi's man pages or help files. I know about :set all but a lot of the options I have no clue what they do. (3 Replies)
Hi
I'm trying to understand variable scopes in solaris10.
It is said that to display env variables we use 3 commands :
- env
- set
- export
What is the difference between them ?
thx for help.
---------- Post updated at 11:00 AM ---------- Previous update was at 10:50 AM ----------
... (2 Replies)
Discussion started by: presul
2 Replies
LEARN ABOUT CENTOS
unsetenv
SETENV(3) Linux Programmer's Manual SETENV(3)NAME
setenv - change or add an environment variable
SYNOPSIS
#include <stdlib.h>
int setenv(const char *name, const char *value, int overwrite);
int unsetenv(const char *name);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
setenv(), unsetenv():
_BSD_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
DESCRIPTION
The setenv() function adds the variable name to the environment with the value value, if name does not already exist. If name does exist
in the environment, then its value is changed to value if overwrite is nonzero; if overwrite is zero, then the value of name is not
changed. This function makes copies of the strings pointed to by name and value (by contrast with putenv(3)).
The unsetenv() function deletes the variable name from the environment. If name does not exist in the environment, then the function suc-
ceeds, and the environment is unchanged.
RETURN VALUE
The setenv() function returns zero on success, or -1 on error, with errno set to indicate the cause of the error.
The unsetenv() function returns zero on success, or -1 on error, with errno set to indicate the cause of the error.
ERRORS
EINVAL name is NULL, points to a string of length 0, or contains an '=' character.
ENOMEM Insufficient memory to add a new variable to the environment.
CONFORMING TO
4.3BSD, POSIX.1-2001.
NOTES
POSIX.1-2001 does not require setenv() or unsetenv() to be reentrant.
Prior to glibc 2.2.2, unsetenv() was prototyped as returning void; more recent glibc versions follow the POSIX.1-2001-compliant prototype
shown in the SYNOPSIS.
BUGS
POSIX.1-2001 specifies that if name contains an '=' character, then setenv() should fail with the error EINVAL; however, versions of glibc
before 2.3.4 allowed an '=' sign in name.
SEE ALSO clearenv(3), getenv(3), putenv(3), environ(7)COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2009-09-20 SETENV(3)