TIA
--
Richard Morriss
ric...@police.tas.gov.au
Information Technology Branch
Tasmania Police Department
man putenv(3C).
Dan
--
======================================================================
Dan Abarbanel | "Warning: Dates in the calendar are
Madge Networks ESD, Israel | closer than they appear!"
Tel: +972 3 6457662 |
Fax: +972 3 6487146 |
e-mail: daba...@madge.com | Disclaimer: You call this an OPINION?
setenv and unsetenv are csh commands. Do a ps to see what shell you
are in, then try 'man ksh' or 'man sh' for your correct syntax.
-/Renegade
Alton> setenv and unsetenv are csh commands.
setenv() and unsetenv() are library functions in BSDish flavours.
int setenv(const char *name, const char *value, int overwrite);
void unsetenv(const char *name)
Not portable to SysVish flavours of course (see putenv()).
--
Andrew.
comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
or <URL: http://www.whitefang.com/unix/>
Alton B. Coalter <rene...@internetMCI.com> wrote:
>setenv and unsetenv are csh commands.
Yeah, but they're also functions in 4.4-Lite's C library (and in the C
library of 4.4-Lite's derivatives, such as FreeBSD); as the original
poster said "from your code", he was probably thinking of the functions,
not the commands.
(Besides, SVR4 *has* a C shell, so it's unlikely that he's running into
a problem of not having them in Solaris 2.5....)
"putenv()" provides similar functionality to "setenv()", at least in the
case where the third argument to "setenv()" is non-zero. There's no
equivalent of "unsetenv()" I know of - but, as most UNIXes tend to
implement the environment in the same fashion, and as 4.4-Lite and
FreeBSD are available in source form, the original poster might consider
just trying to port the FreeBSD "lib/libc/stdlib/setenv.c" and
"lib/libc/stdlib/getenv.c" to Solaris 2.5 (bearing in mind that the
FreeBSD versions might not be MT-safe, if his program is multi-threaded).
--
Reply, or follow up, but don't do both, please.
postmaster@localhost
postmaster@[127.0.0.1]