Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Linux Magazine - Missing Anything?

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Glossary
MoreInfo
Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
FAQ
Copyright Info
Terms of Use
Privacy Info
Disclaimer
WorkBoard
Thanks
Donations
Advertising
Masthead / Impressum
Your Account

Communication
Feedback
Forums
Private Messages
Surveys

Features
HOWTOs
News Archive
Submit News
Topics
User Articles
Web Links

Google
Google


The Web
linux-tutorial.info

Who's Online
There are currently, 195 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here

  

environ



SYNOPSIS

       extern char **environ;


DESCRIPTION

       The  variable environ points to an array of strings called
       the `environment'.  (This variable must be declared in the
       user  program, but is declared in the header file unistd.h
       in case the header files came from libc4 or libc5, and  in
       case  they  came  from glibc and _GNU_SOURCE was defined.)
       This array of strings is made available to the process  by
       the  exec(3) call that started the process.  By convention
       these strings have the form `name=value'.  Common examples
       are:

       USER   The  name  of the logged-in user (used by some BSD-
              derived programs).

       LOGNAME
              The name of the logged-in user (used by  some  Sys­
              tem-V derived programs).

       HOME   A  user's login directory, set by login(1) from the
              password file passwd(5).

       LANG   The name of a locale to use for  locale  categories
              when  not  overridden  by  LC_ALL  or more specific
              environment variables  like  LC_COLLATE,  LC_CTYPE,
              LC_MESSAGES,  LC_MONETARY, LC_NUMERIC, LC_TIME, cf.
              locale(5).

       PATH   The sequence of directory prefixes that  sh(1)  and
              many  other  programs apply in searching for a file
              known by an incomplete path name.  The prefixes are
              separated  by  `:'.  (Similarly one has CDPATH used
              by some shells to  find  the  target  of  a  change
              directory  command,  MANPATH used by man(1) to find
              manual pages, etc.)

       PWD    The current working directory. Set by some  shells.

       SHELL  The file name of the user's login shell.

       TERM   The  terminal  type  for which output is to be pre­
              pared.

       PAGER  The user's preferred utility to display text files.

       EDITOR/VISUAL
              The user's preferred utility to edit text files.

       BROWSER
              The   user's  preferred  utility  to  browse  URLs.

       The variables LANG, LANGUAGE,  NLSPATH,  LOCPATH,  LC_ALL,
       LC_MESSAGES,   etc.   influence   locale   handling,   cf.
       locale(5).

       TMPDIR influences the path prefix of names created by tmp­
       nam(3) and other routines, the temporary directory used by
       sort(1) and other programs, etc.

       LD_LIBRARY_PATH,  LD_PRELOAD  and  other  LD_*   variables
       influence the behaviour of the dynamic loader/linker.

       POSIXLY_CORRECT  makes  certain  programs and library rou­
       tines follow the prescriptions of POSIX.

       The behaviour of malloc(3) is influenced by MALLOC_* vari­
       ables.

       The variable HOSTALIASES gives the name of a file contain­
       ing aliases to be used with gethostbyname(3).

       TZ and TZDIR give time zone information used  by  tzset(3)
       and  through  that by functions like ctime(), localtime(),
       mktime(), strftime().  See also tzselect(1).

       TERMCAP gives information on how to address a given termi­
       nal  (or gives the name of a file containing such informa­
       tion).

       COLUMNS and LINES tell applications about the window size,
       possibly overriding the actual size.

       PRINTER  or LPDEST may specify the desired printer to use.
       See lpr(1).

       Etc.


BUGS

       Clearly there is a security risk here. Many a system  com­
       mand  has  been tricked into mischief by a user who speci­
       fied unusual values for IFS or LD_LIBRARY_PATH.

       There is also the risk of name space pollution.   Programs
       like make and autoconf allow overriding of default utility
       names from the environment with similarly named  variables
       in  all  caps.   Thus  one uses CC to select the desired C
       compiler (and similarly MAKE, AR, AS,  FC,  LD,  LEX,  RM,
       YACC,  etc.).   However,  in some traditional uses such an
       environment variable gives options for the program instead
       of  a pathname.  Thus, one has MORE, LESS, and GZIP.  Such
       usage is considered mistaken, and to  be  avoided  in  new
       programs.  The  authors  of  gzip should consider renaming
       their option to GZIP_OPT.
  
Show your Support for the Linux Tutorial

Purchase one of the products from our new online shop. For each product you purchase, the Linux Tutorial gets a portion of the proceeds to help keep us going.


Login
Nickname

Password

Security Code
Security Code
Type Security Code


Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!


Amazon Wish List

Did You Know?
You can get all the latest Site and Linux news by checking out our news page.


Friends



Tell a Friend About Us

Bookmark and Share



Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 18.1 Seconds