Interview questions

Shell Script interview questions – page 4

134 questions. Tap “Show answer” to check yourself.

  1. What are the additional egrep symbols?

  2. What is the use of "test" command?

  3. Create a bash shell script that removes all files whose names end with a "~" from your home directory and subdirectories. Name this script "cleanup.sh"

  4. What is the syntax of "grep" command?

  5. What is the use of "shift" command in passing parameters?

  6. How to include comments in your shell scripts?

  7. What is the need of including script interpreter in your shell script?

  8. What is "test"? How it is used in shell scripting?

  9. How to declare functions in unix shell script?

  10. How to print some text on to the screen?

  11. How to take input values from the user?

  12. What are the different methods available to run a shell script?

  13. What are special characters and explain how does text varies by the usage of single quotes,double quotes and back quotes?

  14. What are the different shells available?

  15. whta is the use of "exec" command?

  16. What is "umask"?

  17. How to modify the PATH variable and make it executable?

  18. In which variable prompt value is stored?

  19. How to create environment variables? What are the conditions for creating variables?

  20. How to make userdefined variables to available for all other shells?

  21. What is Path variable? What is its use?

  22. What are the advantages of bash over all other shells?

  23. How to change our default shell?

  24. How will you list only the empty lines in a file (using grep)?

  25. How to customise the existing shell?

  26. How to customise the other shell?

  27. What are environment variables?

  28. How would you print just the 25th line in a file using smallest shell script?

  29. What are the different kinds of loops available in shell script?

  30. How do you read arguments in a shell program - $1, $2 ..?

Companies that ask Shell Script questions