Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Raspbian

You're reading from   Learning Raspbian Get up and running with Raspbian and make the most out of your Raspberry Pi

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher
ISBN-13 9781784392192
Length 154 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
William Harrington William Harrington
Author Profile Icon William Harrington
William Harrington
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. The Raspberry Pi and Raspbian 2. Getting Started with Raspbian FREE CHAPTER 3. Starting Raspbian 4. An Introduction to the Raspbian Desktop 5. Installing Software on Raspbian 6. The Console 7. Other Linux Distributions Based on Raspbian A. 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 €18.99/month. Cancel anytime