O'Reilly logo

Practical UNIX by Steve Moritsugu - DTR Business Systems

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating and Using Your Own Variables

You will often find it convenient to store the output of a command you run in your script for use later in the script. Or, you might want to hard-code some information such as a long directory path, but you don’t want to type the whole path every time you need to use it in the script. And if this directory path ever needs to be changed, it would be nice to be able to change it in only one place in the script and yet have it take effect throughout the script. To do this, you must create a variable. A shell variable begins with any letter or underscore (_) character, followed by zero or more numbers, letters, or underscores.

UNIX is Case-Sensitive

Remember that UNIX is case-sensitive. You must use the same ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required