🧪 Shell Scripting MCQ Quiz Hub

Shell Scripting Mcq Question Set 1

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

1. What is a shell script?




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




3. Shell scripts are executed in a separate child shell process.




4. The first line in any shell script begins with a _____




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




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




7. Which command is used for making the scripts interactive?




8. read command is shell’s internal tool.




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




10. What are positional parameters?




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




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




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




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




15. Which of the following keywords are used in while loop?




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




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




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




19. Which command is used for changing filename extensions?




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




21. ____ statement is used for shifting arguments left.




22. Which one of the following is an internal command?




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




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




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




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




27. We can use the here document with interactive programs also.




28. ____ command is the appropriate way to interrupt a program.




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




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




31. Given x=10 then, The given statement is ____




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




33. Where is the exit status of a command stored?




34. Which of the following is false?




35. test statement cannot ______




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




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




38. Shell provides us with an interface to the operating system.




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




40. There can be multiple kernels on a single UNIX system.




41. The prompt issued by the shell is called ______




42. In UNIX there are ___ major types of shells.




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




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




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




46. Which shell is the most common and best to use?




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




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




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




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