Scripting Basics Flashcards

1
Q

Script

A

A program written in an interpreted language, typically associated with a shell or a compiled program.

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

What does ‘&’ mean in a script

A
  • Allows for multiple programs to be launched
  • Tells the script it can continue without waiting for the command to finish executing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

find command

A

Find a file based on filenames, ownership, and other permissions at that file system level

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

cut command

A

Extract text from a field within a file.

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

Echo command

A

Display a message in the command line window.

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

Arguments

A

Variables that are passed to the script. These are also called parameters

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

Conditional Expressions

A

Enable a script to perform one of several actions relying on a particular condition or value of a variable

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

&&

A

logical and

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

||

A

logical or

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

if then fi

A
  • If then statement
  • close with fi
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

case

A
  • Uses a variable, and each pattern shown before the right parenthesis is a possible value of that variable.
  • If the user’s entry is equal to the value before the parenthesis, the case is run.
  • Like a menu, avoid redundant nested if/then
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Loops

A

Tell the script to perform the same task repeatedly

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

seq command

A

Generates a list of numbers starting from its first argument and continuing to its last one

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

while loop

A

Execute as long as the condition is true

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

until loop

A

Continues to execute as as its conditions is false or until the condition becomes true

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

Exit Value

A

last command of the script

17
Q

Exit

A

causes the immediate termination of the script