Class 21 Flashcards

1
Q

What does Bash do when it performs history expansion?

A

it reruns an old command line which it retrieves from the history list

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

What does Bash do when it performs alias substitution?

A

it replaces the name of the alias with a Unix command

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

Write the command you would use to create the files foo1.txt to foo5.txt using brace expansion and the touch command.

A

touch foo{1,2,3,4,5}.txt

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

What does Bash do when it performs tilde (~) expansion?

A

replaces ~ with the absolute address of your home directory or replaces ~UNIX_USERNAME with the absolute address of the home directory of UNIX_USERNAME

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

What does Bash do when it performs parameter and variable expansion?

A

substitutes the value of a variable or a parameter for the name of the variable or parameter when preceded by a $

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

What does Bash do when it performs arithmetic expansion?

A

treats the digits inside double parentheses as numbers, performs arithmetic operations on them and substitutes the result of that calculation for the expansion expression

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

What does Bash do when it performs command substitution?

A

runs the commands inside the parentheses in a subshell and substitutes the output from those commands for the substitution expression

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

What would you write at the command line to define the alias ll whose value was ls -l ?

A

alias ll=’ls -l’

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

Can an alias be made global?

A

no

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

Can a function be made global?

A

no

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