πŸ§ͺ Shell Scripting MCQ Quiz Hub

Shell Scripting Mcq Question Set 1

Choose a topic to test your knowledge and improve your Shell Scripting skills

What is a shell script?





βœ… Correct Answer: 3

Shell scripts need to be saved with an extension .sh .





βœ… Correct Answer: 1

Shell scripts are executed in a separate child shell process.





βœ… Correct Answer: 1

The first line in any shell script begins with a _____





βœ… Correct Answer: 4

To run the script, we should make it executable first by using _____





βœ… Correct Answer: 1

To spawn a child of our own choice for running the script, we can use ___ command.





βœ… Correct Answer: 3

Which command is used for making the scripts interactive?





βœ… Correct Answer: 3

read command is shell’s internal tool.





βœ… Correct Answer: 1

A single read statement can be used with one or more variables.





βœ… Correct Answer: 1

What are positional parameters?





βœ… Correct Answer: 1

The first argument is read by the shell into the parameter ___





βœ… Correct Answer: 4

The complete set of positional parameters is stored in ______ as a single string.





βœ… Correct Answer: 3

Which of the following is used for storing the number of positional parameters?





βœ… Correct Answer: 2

Which of the following commands let us perform a set of instructions repeatedly?





βœ… Correct Answer: 4

Which of the following keywords are used in while loop?





βœ… Correct Answer: 4

until loop operates with a reverse logic as used in while loop.





βœ… Correct Answer: 1

Which one of the following is used for looping with a list?





βœ… Correct Answer: 4

Which of the following loop statements uses do and done keyword?





βœ… Correct Answer: 4

Which command is used for changing filename extensions?





βœ… Correct Answer: 3

Which command is used by the shell for manipulating positional parameters?





βœ… Correct Answer: 1

____ statement is used for shifting arguments left.





βœ… Correct Answer: 2

Which one of the following is an internal command?





βœ… Correct Answer: 3

Which symbol is used with the set command for command substitution?





βœ… Correct Answer: 2

The ____ allows us to read data from the same file containing the script.





βœ… Correct Answer: 2

Any command using standard input can take the input from here document.





βœ… Correct Answer: 1

Which of the following command doesn’t accept a filename as an argument?





βœ… Correct Answer: 4

We can use the here document with interactive programs also.





βœ… Correct Answer: 1

____ command is the appropriate way to interrupt a program.





βœ… Correct Answer: 4

Which of the following option is used with a set for debugging shell scripts?





βœ… Correct Answer: 2

Suppose x =10, then what will be the value of x$x$?





βœ… Correct Answer: 4

Given x=10 then, The given statement is ____





βœ… Correct Answer: 1

A shell script stopped running when we change its name. Why?





βœ… Correct Answer: 3

Where is the exit status of a command stored?





βœ… Correct Answer: 4

Which of the following is false?





βœ… Correct Answer: 3

test statement cannot ______





βœ… Correct Answer: 3

___ option is used with a test for checking if the file exists and has the size greater than zero.





βœ… Correct Answer: 4

Every time shift command is used, the leftmost variable is lost.





βœ… Correct Answer: 1

Shell provides us with an interface to the operating system.





βœ… Correct Answer: 1

On a UNIX system, there can be ____ shells running simultaneously.





βœ… Correct Answer: 3

There can be multiple kernels on a single UNIX system.





βœ… Correct Answer: 1

The prompt issued by the shell is called ______





βœ… Correct Answer: 3

In UNIX there are ___ major types of shells.





βœ… Correct Answer: 1

What is the default symbol for command prompt in Bourne shell?





βœ… Correct Answer: 1

What is the default symbol for command prompt in C shell?





βœ… Correct Answer: 2

Which one of the following command will display the name of the shell we are working on?





βœ… Correct Answer: 3

Which shell is the most common and best to use?





βœ… Correct Answer: 4

Which command does not terminates unless we log out of the system?





βœ… Correct Answer: 2

In Shell’s interpretive cycle, the shell first scans for ____ in the entered command.





βœ… Correct Answer: 3

Which of the following expression is a correct wildcard pattern if we want an expression in which the last character is not numeric?





βœ… Correct Answer: 4

The shell waits for the command to complete and normally can’t do any work while the command is executing.





βœ… Correct Answer: 1