Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning Raspbian

You're reading from  Learning Raspbian

Product type Book
Published in Feb 2015
Publisher
ISBN-13 9781784392192
Pages 154 pages
Edition 1st Edition
Languages
Author (1):
William Harrington William Harrington
Profile icon William Harrington

Table of Contents (15) Chapters

Learning Raspbian
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
The Raspberry Pi and Raspbian Getting Started with Raspbian Starting Raspbian An Introduction to the Raspbian Desktop Installing Software on Raspbian The Console Other Linux Distributions Based on Raspbian References Index

Environmental variables


Another powerful feature of bash is the use of environmental variables. Environmental variables are values that are stored in memory and can be used to temporarily store information and settings. One example of this is the PATH variable. The PATH variable tells bash where to look for any programs if they aren't in the current directory.

All the current environmental variables set can be displayed using the printenv command. They are loaded into memory automatically when your Raspberry Pi boots up.

Some of the environmental variables set up by default in Raspbian

You can define your own environmental variables easily in bash. By convention, in bash, all environmental variables are defined using capital letters.

To define an environmental variable, you can do as shown in the following screenshot:

Defining the MY_VARIABLE environmental value

Environmental variables can be used just as easily. To use an environmental variable, simply add $ before it.

Using the MY_VARIABLE environmental...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}