Shell scripting interview question answers

Shell scripting has emerged from automation of normal day to day operational task of system administrator, network administrator, database administrator all the way upto bigdata these days. Shell scripting interview questions are going to be integral part of DBA interview, sys admin interview, bigdata interview, network admin interview, production support interview, build script creation team interview, upgrade script creation team interview and many more. Start preparing for the upcoming interview using our shell scripting interview questions and answers 1) What does $# mean in shell environment? In a shell script mainly bash shell it is common to see if a parameter has been passed to the code. To check this $# eq command is used. Eg: if [$# eq 2]; then means is two positional parameters have been passed during script execution 2) How does a bach script start? #!/bin/bash 3) What does $0 mean in bash shell script? In bash shell environment $0 is a special parameter that means the name of the shell if used in command prompt, name of shell script if used within shell script 4) How will you exit a bash shell? Using command exit 1