Most asked top Interview Questions and Answers & Online Test
Education platform for interview prep, online tests, tutorials, and live practice

Build skills with focused learning paths, mock tests, and interview-ready content.

WithoutBook brings subject-wise interview questions, online practice tests, tutorials, and comparison guides into one responsive learning workspace.

Prepare Interview

Shell Scripting Interview Questions and Answers

Ques 16. What is the purpose of the `basename` command in shell scripting?

The `basename` command is used to strip directory and suffix from filenames.

Is it helpful? Add Comment View Comments
 

Ques 17. How can you check the status of the last command in a shell script?

You can use the `$?` variable to check the exit status of the last command.

Is it helpful? Add Comment View Comments
 

Ques 18. Explain the use of the `expr` command in shell scripting.

The `expr` command is used for evaluating expressions in shell scripts.

Is it helpful? Add Comment View Comments
 

Ques 19. What is the purpose of the `export` command in shell scripting?

The `export` command is used to make environment variables available to child processes.

Is it helpful? Add Comment View Comments
 

Ques 20. How do you use the `while` loop in a shell script?

The `while` loop is used to repeatedly execute a block of statements as long as a condition is true.

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

Copyright © 2026, WithoutBook.