three Flashcards

1
Q

Time out a read format

A

read -t 10 -p “info” variabel

if the variable is not input within the standard time, the process will abort

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is the internal field separator

A

$IFS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

in order to display the value of IFS, what can we do?

A

cat -etv

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

read from string

A

read var1 var2 var3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to change the internal Field Separator

A

IFS=delimiter
restore it to its old value
IFS=”$old”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

read -r

A

if -r is specified, the backslash is part of the line, not as an escape character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

perform integer expression

A

$((expression including integers only))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

the integer operator in $(())

A

++ pot-increment

**exponential

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

create an integer variable

A

declare -i y=value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

create readonly variable

A

readonly var
the var can be declared earlier than the readonly expression, once var is defined as readonly, it cannot be changed or unset

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

variable existence check

A

${var:?info}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

local variables

A

user defined not exported

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

environmental variables

A

exported

will be passed to subprocesses or subshells

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

create readonly variable

A

readonly var
the var can be declared earlier than the readonly expression, once var is defined as readonly, it cannot be changed or unset

How well did you know this?
1
Not at all
2
3
4
5
Perfectly