Bash Shell Scripting- Difference between $@ and $*

Bash Shell Scripting- Difference between $@ and $*

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Hard

Created by

Quizizz Content

FREE Resource

The video tutorial explains the differences between the dollar at the rate ($@) and dollar star ($*) symbols in shell scripting. It demonstrates how these symbols handle command line arguments differently, especially when used within for loops and with quotations. The tutorial provides examples to illustrate these differences and offers recommendations on when to use each symbol for handling arguments effectively.

Read more

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What do dollar at the rate and dollar star represent in shell scripting?

All system commands

All shell scripts

All command line arguments

All environment variables

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output when no command line arguments are passed to a script using dollar at the rate or dollar star?

The script name

An empty output

A default value

An error message

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a for loop, what does dollar star display when used without escape characters?

The script name

Only the first argument

No output

All command line arguments

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of using a slash symbol with dollar star in a for loop?

To concatenate arguments

To split the arguments

To comment out the line

To escape the dollar symbol

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How does using quotations affect the behavior of dollar star in a for loop?

It treats all arguments as separate

It duplicates the arguments

It treats all arguments as a single argument

It ignores all arguments

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When using dollar at the rate with quotations, how are the arguments treated?

As separate arguments

As a single string

As environment variables

As a single argument

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the recommended practice when working with command line arguments in shell scripts?

Avoid using any quotations

Use dollar at the rate with quotations

Use both without any escape characters

Use dollar star without quotations