Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
058 060 Environment

058 060 Environment

Ratings: (0)|Views: 102|Likes:
Published by Jack James

More info:

Published by: Jack James on Jul 02, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/09/2014

pdf

text

original

 
U
buntu’s Terminal accessoryopens a text-based commandwindow that uses a commandsystem called Bash (Bourne AgainSHell).To access the terminal window, select
 Accessories | Terminal
in the Ubuntumain window.If you enter a command like
ls
in theshell, the shell knows you want to callthe
 /bin/ls
program. Bash knows whereto look for executables, so you don’tneed to type in the full path. This path isdefined in what is known as an environ-ment variable. Variables of this kind arealso used to modify the appearance of the shell prompt, set the time zone andthe user’s home directory, and manyother things.An environment variable has threeparts: the name, an assignment operator(
=
), and a value:
variable=value
The name can include upper- and lower-case letters, underlines, and numbers.The only restriction is that a table can’tstart with a number. If the value of the
expincd uss on Unix/ Linux-asd systms such as Uuntu somtims pf to wok in txt mod foma tminal window. W’ll show you som tminal ticks with nvionmnt vaials.
BY HEIKE JURZIK
Make yourself at home
ENVIRONMENTAL
01 huhn@asteroid:~$ env02 TERM=xterm03 SHELL=/bin/bash04 USER=huhn05 LS_COLORS=no=00:fi=00:...06 PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/huhn/bin07 IRCSERVER=irc.freenode.net08 LANG=de_DE@euro09 ...
Listing 1: env Example
Instead of using two separate com-mands (e.g.,
LESS="-X"; export LESS 
),you can define and export all at once:
export LESS="-X" 
.
Tip
builtin:
an abbreviation for “built-incommand.” Commands like this arebuilt in to the shell, and you do not needto run a special program to use them.
GLOSSARY
 G  al   yn aAn d  u s o ,1   3 f   . c om
Environment Variables
Desktop
58
ISSUE 01
 UbUNTU USer
 
variable contains blanks or nonstandard characters, you haveto double-quote your input:
LESS="‑X"
Welcome Home
Every user on an Ubuntu system has a place he or she cancall home; Bash provides a fully furnished environment forevery single account. To discover which variables your homeuses, type
env
(for “environment”).Listing 1 shows an example. Some of the variables in List-ing 1 are set by the user. Other shell variables are predefinedbut can be modified as necessary. The convention is to useuppercase letters.Table 1 gives an overview of common variables for Bash.
Looking into Cupboards
The
echo
command allows you to discover the value of a vari-able. To display the value of an environment variable, use the
echo
command with a dollar sign in front of the variablename:
huhn@asteroid:echo $LANGde_DE@eurohuhn@asteroid:echo $PS1\u@\h:\w\$
The shell replaces the variables
$LANG
and
$PS1
with theirrespective values and then calls
echo
to output the text.
01 huhn@asteroid:~$ export02 declare ‑x CHARSET="latin1"03 declare ‑x LS_COLORS="no=00:fi=00:..."04 declare ‑x IRCSERVER="irc.freenode.net"05 ...06 huhn@asteroid:~$ export ‑n IRCSERVER
Listing 2: export Example
Figure 1: The .bashrc file in your home directory provides informa-tion on the Bash environment. First, choose Places in the Ubuntumain window and then Home Folder. If you don’t see .bashrc in theFile Browser, select the View menu and click on Show Hidden Files.
GET YOUR HANDS ON SOME
HOT NEW BOOKSFROM APRESS
For more information about Apress titles,please visit
www.apress.com
Don’t want to wait for the printed book?Order the eBook now at
http://eBookshop.apress.com
!
Peter Seebach978-1-4302-1043-6$34.99
|
376 pp
|
November 2008Ron Peters978-1-4302-1841-8$39.99
|
330 pp
|
December 2008Kirk Bauer and Nathan Campi978-1-4302-1059-7$49.99
|
425 pp
|
December 2008 Andy Channelle978-1-4302-1590-5$39.99
|
500 pp
|
December 2008Sander van Vugt978-1-4302-1622-3$44.99
|
400 pp
|
December 2008Sander van Vugt978-1-4302-1082-5$39.99
|
424 pp
|
September 2008

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->