Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Debian GNU/Linux Reference Guide
Prev Home Next

4.3.5 Command execution and environment variable

Typical command execution uses a shell line sequence like the following: [28]

     $ date
     Sun Oct 26 08:17:20 CET 2003
     $ LC_ALL=fr_FR date
     dim oct 26 08:17:39 CET 2003

Here, the program date is executed in the foreground job. The environment variable LC_ALL is:

  • unset (system default, same as C) for the first command

  • set to fr_FR (French locale) for the second command

Most command executions usually do not have preceding environment variable definition. For the above example, you can alternatively execute:

     $ LC_ALL=fr_FR
     $ date
     dim oct 26 08:17:39 CET 2003

As you can see here, the output of command is affected by the environment variable to produce French output. If you want the environment variable to be inherited to the subprocesses (e.g., when calling shell script), you need to "export" it instead by using:

     $ export LC_ALL

Debian GNU/Linux Reference Guide
Prev Home Next

  Published under the terms of the GNU General Public License Design by Interspire