Class 17 Quiz Flashcards

1
Q

What is the value of the file descriptor for Standard Input?

A

0

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

What is the value of the file descriptor for Standard Output?

A

1

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

What is the value of the file descriptor for Standard Error?

A

2

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

If you wanted to run the executable file backup in your current directory, but wanted the error messages to disappear, what would you write at the command line?

A

./backup 2> /dev/null

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

If you wanted to run the executable file backup in your current directory, but wanted both the output and the error messages to go to the file results.txt, what would you write at the command line?

A

./backup &> results.txt

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

What would you type at the command line, if you wanted to make the script cheer.sh executable?

A

chmod 755 cheer.sh

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

Write the hashbang line we use for scripts in this course.

A

! /bin/bash

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

Write the hashbang line you would use if you wanted a script to run using the sh shell.

A

! /bin/sh

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

Name the three categories of people who might need to read a shell script.

A

the person who wrote the script, the persons who use the script and the person who maintains the script

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

What command would you use to make the changes you made in the startup file for your login shell take effect?

A

source .bash_profile

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