From owner-freebsd-questions Sat Jun 26 7:17: 5 1999 Delivered-To: freebsd-questions@freebsd.org Received: from wph.bbs.edu.cn (unknown [203.207.229.95]) by hub.freebsd.org (Postfix) with ESMTP id 5F68214D5C for ; Sat, 26 Jun 1999 07:16:57 -0700 (PDT) (envelope-from peihanw@mx.cei.gov.cn) Received: from mx.cei.gov.cn (localhost [127.0.0.1]) by wph.bbs.edu.cn (8.9.3/8.8.7) with ESMTP id WAA06123 for ; Sat, 26 Jun 1999 22:17:24 +0800 (CST) (envelope-from peihanw@mx.cei.gov.cn) Message-ID: <3774E0F2.66FECA2D@mx.cei.gov.cn> Date: Sat, 26 Jun 1999 22:17:22 +0800 From: Peihan Wang X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 3.2-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG Subject: char* getenv(const char*) (3) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I am writing a simple program which calling lib function getenv(). But there is something I can not explain. The code char * cp = getenv("PATH"); works fine, while other two usage cp = getenv("PPID"); cp = getenv("PIPESTATUS"); just return NULL. Under shell(bash2.01), I type $ set ... PATH=/sbin:/usr/sbin:/bin:/usr/bin.... PIPESTATUS=([0]="0") PPID=258 ... $ echo $PPID 258 $ echo $PIPESTATUS 0 Why getenv does not work with PPID & PIPESTATUS ? How shell obtain these info ? Thanx. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message