three Flashcards
Time out a read format
read -t 10 -p “info” variabel
if the variable is not input within the standard time, the process will abort
what is the internal field separator
$IFS
in order to display the value of IFS, what can we do?
cat -etv
read from string
read var1 var2 var3
How to change the internal Field Separator
IFS=delimiter
restore it to its old value
IFS=”$old”
read -r
if -r is specified, the backslash is part of the line, not as an escape character
perform integer expression
$((expression including integers only))
the integer operator in $(())
++ pot-increment
**exponential
create an integer variable
declare -i y=value
create readonly variable
readonly var
the var can be declared earlier than the readonly expression, once var is defined as readonly, it cannot be changed or unset
variable existence check
${var:?info}
local variables
user defined not exported
environmental variables
exported
will be passed to subprocesses or subshells
create readonly variable
readonly var
the var can be declared earlier than the readonly expression, once var is defined as readonly, it cannot be changed or unset