Bash - Parameter

Bash Liste Des Attaques Ovh

About

A variable in bash is called a parameter.

There is three different type of parameter

A parameter can be then referenced by:

  • a name,
  • a number
  • or a special symbol (Special Character)

A parameter is set if it has been assigned a value. (The null string is a valid value)

Management

See also Bash - Parameter Expansion ${

Check if set

  • -z string has zero length
if [ -z ${var+x} ]; then
  echo "var is unset"; 
else 
  echo "var is set to '$var'"; 
fi

where

or -n: string is not null

if [ -n ${var+x} ]; then
  echo "var is set to '$var'"; 
else 
  echo "var is unset"; 
fi





Discover More
Bash Liste Des Attaques Ovh
Bash - (Argument|Positional Parameter)

An argument is a parameter given: to a command to a function or to the bash shell They are referenced by position. A positional parameter is a parameter denoted: by one or more digits, ...
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 - Parameter Expansion ${

Parameter expansion are patterns applied to the parameters that have different results. Same as ?? See also: The value of parameter is substituted where: the braces are optional. They served...
Bash Liste Des Attaques Ovh
Bash - Quoting

$, ‘, “, \, or . A double quote may be quoted within double quotes by preceding it with a backslash. If enabled, history expansion will be performed unless an ! appearing in double quotes is...
Bash Liste Des Attaques Ovh
Bash - Special Parameter

Special parameters are Parameters treated specially. metacharacter ?? These parameters may only be referenced; assignment to them is not allowed. Positional parameter expansion Star () At...



Share this page:
Follow us:
Task Runner