Variables

Linux shell programming is a full-fledged programming language and, as such, supports various types of variables. Variables have three major types: environment, built-in, and user.

  • Environment variables are part of the system environment, and you do not have to define them. You can use them in your shell program. Some of them, such as PATH, can also be modified within a shell program.

  • Built-in variables are provided by the system. Unlike environment variables, you cannot modify them.

  • User variables are defined by you when you write a shell script. You can use and modify them at will within the shell program.

A major difference between shell programming and other programming languages is that in shell programming, variables are not typecast. ...

Get Red Hat® Linux® 7 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.