review Flashcards

1
Q

What kind of operators are used to compare strings in bash?

A

symbols

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

whta kind of operators are used to compare numbers in bash,

A

-lt, -gt, eq,

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

if I print num1=ipaddr

what is printed and why?

A

when using backquotes the command is printed

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

What symboils need to have there special meaning taken away to be printed?
n
t

*
\
` backtick

A

\
*

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

When using quotes in bash, what do single quotes represent?

A

The literal string value of what’s printed

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

When using quotes in bash what do back quotes represent `

A

I use them to capture the output of a command, so I wanted to add a variable thast contains the output of the date command I’d add back quotes

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

What does $0 represent bash?

A

Name of the command used to call current program

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

What does $# represent in bash?

A

Stores the number of arguments passed to script or function

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

What does $* represent in bash?

A

Refrences all argyuments passed to a script or function

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

What does $1, $2, $3 represent in bash?

A

Stors the fist nine arguments in incrementing variables passed to script or function

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

What does $? represent in bash?

A

stores ecxit status of previous command

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

How do I find the length of a string? Which of therse commands will work and what do I need to do to them to make it work? What do both do?

${[name[*]}

${#name[*]]}

A

returns all the values of an array as a single output

returns the number of elements of an array or if an index is placed inside will give the length of that specific element

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

What branching statements are used in bash?

What kind of brackets are used when evaluating them?

A

if, then, elif, else, fi

[]

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

What symbol declares a character class in regex

A

[]

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

What stream number represents STDIN?

A

0

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

What stream repsents STDOUT?

A

1

17
Q

what stream represents STDERR

A

2

18
Q
A