SLG ULI101 Week 12 - Bash II

SLG ULI101 Week 12 - Bash II

Professional Development

20 Qs

quiz-placeholder

Similar activities

Excel Formula

Excel Formula

4th Grade - Professional Development

20 Qs

1ºDAM/DAW - Lenguajes de Marcas - UD2-3-9 - Prof. C. Boni

1ºDAM/DAW - Lenguajes de Marcas - UD2-3-9 - Prof. C. Boni

University - Professional Development

20 Qs

Test what you know about Roblox Studios

Test what you know about Roblox Studios

1st Grade - Professional Development

16 Qs

PLSQL_2324

PLSQL_2324

Professional Development

18 Qs

MindSpace Computers C Test-3 2023

MindSpace Computers C Test-3 2023

Professional Development

15 Qs

command prompt

command prompt

4th Grade - Professional Development

15 Qs

JS

JS

Professional Development

15 Qs

24/01/2024

24/01/2024

Professional Development

15 Qs

SLG ULI101 Week 12 - Bash II

SLG ULI101 Week 12 - Bash II

Assessment

Quiz

Computers

Professional Development

Practice Problem

Medium

Created by

Novell Rasam

Used 8+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

In a Bash script, how do we use grep without outputting anything to the terminal?

grep "REGEXP" > /dev/null 2>&1

grep "REGEXP" > /dev/null

grep "REGEXP"

grep "REGEXP"

$?

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

If we wanted to check if the number of arguments doesn't equal 1, we write...

if [ $# -ne 1 ]

if [ $? -ne 1 ]

if [$# -ne 1]

if [ $1 -ne 1 ]

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the significance of double parenthesis in Bash?

Allows us to do mathematical operations

Allows us to concatenate strings

No significance over single ()

None of the above

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

If we wanted our echo to overwrite the same line (so no new lines) we write...

echo -n "BLAHBLAH"

echo -ne "BLAHBLAH\r"

echo -ne "BLAHBLAH\n"

echo -ne "BLAHBLAH"

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

If we wanted to loop through each argument we would write...

for thing in $@

for thing in $#

for thing in $1 $2 $3

for thing in $args

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

$@ returns?

all arguments separated by a space

all arguments with no spaces

the number of arguments

none of the above

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

To save the output of a command to a variable we write...

today=$(date -I)

today=date -I

date -I > $today

echo date -I

read today

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?