Shell programming or shell scripting consists of most of the features that modern programming languages have to offer. Any script, simple to complex, can be developed using Shell scripting. It is a series of UNIX commands written to accomplish a particular task using a plain text file. Tasks of day-to-day life can be automated with the help of shell scripting.Â
If you are new to the concepts of Unix, shell, and Perl, read it here. If you have knowledge about shell scripting and have to face a related job interview, then this shell scripting interview questions and answer article will help you with the top shell scripting interview questions that can make your preparation easy.
Shell Scripting Interview Questions & Answers | Linux Admin Certification Training | Edureka
Download PDF Your requested download is ready! Click
Shell scripting has the following disadvantages:
9. When the script is running in the UNIX, can you pass arguments to it?
Yes, arguments can be passed, and it is a commonly followed practice. It is carried out to ensure the system does not have an error in executing commands and scripts run smoothly.Â
Interview Questions for Intermediate
C is a more preferable option in the following cases:
46. Name the command that one should use to know how long the system has been running.
Using the Uptime command, you can see how long your system has been active. You can also determine the number of users with running sessions, and the average system load for 1, 5, and 15 minutes. The information displayed at once can also be filtered based on your specified options.
Example: $ uptime
Entering the above command at the shell prompt, namely $ uptime, will produce the following output:
9:21am up 86 day(s), 11:46, 3 users, load average: 2.24, 2.18, 2.16
Case 1: When parameters are not passed
q54.1 – Shell Scripting Interview Questions – Edureka
Case 2: When the parameter is correctly passed
q54.2 – Shell Scripting Interview Questions – Edureka
3. Name commonly used shells on a typical Linux system.
There are mainly two kinds of Linux shells- C-shell and Bourne shell. Their derivatives are as follows: