Friday 6 February 2015

Linux Shell Scripting interview Questions and Answers (Page 4)

Below are some important Shell Scripting interview questions which are asked in most MNC company interviews for beginners or professionals.

31. What is environment variable?
An environment variable is a variable that is available to any child process of the shell. Some programs need environment variables in order to function correctly. Usually a shell script defines only those environment variables that are needed by the programs that it runs.

32. What is shell variable?
A shell variable is a special variable that is set by the shell and is required by the shell in order to function correctly. Some of these variables are environment variables whereas others are local variables.

33. Explain the “Exit” command?
Every program whether on UNIX or Linux should end at a certain point of time and successful completion of a program is denoted by the output 0. If the program gives an output other than 0 it defines that there has been some problem with the execution or termination of the problem. Whenever you are calling other function, exit command gets displayed.

34. How do you find out what’s your shell?
echo $SHELL

35. How you will run a process in the background?
./ProcessName &

36. How do you write a while loop in shell?
Use While Loop

37. How do you read keyboard input in shell scripts?
Use read command

38. What is GUI Scripting?
Graphical user interface provided the much needed thrust for controlling a computer and its applications. This form of language simplified repetitive actions. Support for different applications mostly depends upon the operating system. These interact with menus, buttons, etc.

39. Explain the term “loops”?
Loops enable you to execute a series of commands multiple times. Two main types of loops are the while and for loops.

40. What is “Nested Loops”?
When a loop is located inside the body of another loop it is said to be nested within another loop.
More Questions & Answers :-

No comments:

Post a Comment