What is Variable Expansion in Bash ?

Bash Liste Des Attaques Ovh

About

variable expansion is an expansion that replaces a variable expression by its value.

Example

Prerequisite: We set the value of the variable foo to bar to perform the expansion

foo=bar 



Example:

  • In the following expression that is composed of:
echo ${foo}
  • The variable expression foo will be replaced / expanded by the value bar at runtime resulting to
echo bar

that outputs to the console

bar





Discover More
Bash Liste Des Attaques Ovh
Bash - (Environment) Variable

A variable is a parameters referenced by a name. parameter A variable has: a value and zero or more attributes (such as integer, ...). Attributes are assigned using the declare builtin command....
Bash Liste Des Attaques Ovh
Bash - Case

The case control statement execute commands based on regular expression pattern matching. Initscript example: Selectively execute COMMANDS based upon WORD matching glob PATTERN. The | is used to...
Bash Liste Des Attaques Ovh
Bash - Expansion

This article is expansion in Bash. An expansion is the replacement of a special token in your code by the result of the expansion during code execution. It's performed on the command line after it has...



Share this page:
Follow us:
Task Runner