CSE 15L Lab 8

CSE 15L Lab 8

University

8 Qs

quiz-placeholder

Similar activities

Comandos do Terminal Linux

Comandos do Terminal Linux

4th Grade - Professional Development

10 Qs

Review Javascript DOM

Review Javascript DOM

University - Professional Development

10 Qs

File Processing

File Processing

University

8 Qs

Fundamentos de Shell Script

Fundamentos de Shell Script

11th Grade - University

12 Qs

Coding and Logic (Mitchell)

Coding and Logic (Mitchell)

KG - Professional Development

10 Qs

JQuery test rus

JQuery test rus

University

10 Qs

Linux CLI

Linux CLI

University

11 Qs

html тегтеріне тапсырма

html тегтеріне тапсырма

University

10 Qs

CSE 15L Lab 8

CSE 15L Lab 8

Assessment

Quiz

Computers

University

Hard

Created by

Genevieve Dietz

Used 56+ times

FREE Resource

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

Media Image

How do you run a bash script named script.sh?

java script.sh

cd script.sh

bash script.sh

ba script.sh

2.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

What does set -e do?

all executed commands are printed to the terminal

exit if any command has a non-zero exit status

causes the program to immediately exit

the script can still run even if a command returns a non-zero exit status

3.

MULTIPLE SELECT QUESTION

45 sec • 2 pts

What is the right syntax for an if statement that checks if the path for val exists?

[[ -e <val> ]]

[ -e <val> ]

[[-e <val>]]

[-e <val>]

4.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

Media Image

Which symbol reads the repository link you passed when executing grade.sh (first command line argument)?

$?

$$

$0

$1

5.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

What does $? do?

represents the list of arguments passed to the current process

prints to standard out

represents the exit status of the previous command

prints to standard error

6.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

Media Image

Where might it be useful to use or check an exit code?

in scripts that run known code or use known data

in scripts that run unknown code or use unknown data

it's never useful in bash scripts

after a print statement

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What does cp -r source dest do?

copy directories recursively

removes files located in the dest directory

removes each existing destination file before attempting to open it

replaces dest with source

8.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

What command can we use to redirect stderr to stdout and then both to file.txt?

cmd 2>1>>file.txt

cmd 2>file.txt

cmd >file.txt 2>&1

cmd >file.txt $2&1>