Re: Environment Bash
From: Floyd Davidson (floyd_at_barrow.com)
Date: 08/25/03
- Next message: Barry Margolin: "Re: Detect if straced or debugged"
- Previous message: David Butenhof: "Re: mutex lock timeout"
- In reply to: Marco de Boer: "Environment Bash"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 25 Aug 2003 07:06:14 -0800
"Marco de Boer" <marco_de_boer@hotmail.com> wrote:
>Hi,
>
>Why is getenv("OSTYPE") NOT working? (among others like COLUMNS,LINES)
>Why is getenv("USER") working? (among others like PATH,HOME)
>I am using Mandrake 9.1 (Bamboo) and gcc 3.2.2
>
>Marco
>
>#include <stdio.h>
>#include <stdlib.h>
>
>int main()
>{
> printf("%s\n",getenv("PATH")); // OK
> printf("%s\n",getenv("OSTYPE")); // NOT OK: null
> return 0;
>}
NAME
getenv - get an environment variable
SYNOPSIS
#include <stdlib.h>
char *getenv(const char *name);
DESCRIPTION
The getenv() function searches the environment list for a
string that matches the string pointed to by name. The
strings are of the form name = value.
RETURN VALUE
The getenv() function returns a pointer to the value in
the environment, or NULL if there is no match.
-- Floyd L. Davidson <http://web.newsguy.com/floyd_davidson> Ukpeagvik (Barrow, Alaska) floyd@barrow.com
- Next message: Barry Margolin: "Re: Detect if straced or debugged"
- Previous message: David Butenhof: "Re: mutex lock timeout"
- In reply to: Marco de Boer: "Environment Bash"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]