InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
Where is the exit status of a command stored?(a) $0(b) $>(c) $1(d) $?I got this question in final exam.This key question is from Shell Programming using Various Commands in section Essential Shell Programming of Unix |
|
Answer» The correct choice is (d) $? |
|
| 52. |
Which of the following is false?(a) here document provides standard input to any script non interactively(b) read command is used for making scripts interactive(c) $* stores the number of arguments specified(d) && and || are logical operatorsThis question was addressed to me in my homework.I would like to ask this question from Shell Programming using Various Commands in section Essential Shell Programming of Unix |
|
Answer» Correct choice is (c) $* STORES the number of arguments specified |
|
| 53. |
Which of the following option is used with a set for debugging shell scripts?(a) -a(b) -x(c) -d(d) -eThe question was posed to me in an online quiz.This question is from Shell Programming using Various Commands in portion Essential Shell Programming of Unix |
|
Answer» Correct choice is (B) -x |
|
| 54. |
Which of the following command doesn’t accept a filename as an argument?(a) cut(b) ls(c) paste(d) mailxI had been asked this question in my homework.Origin of the question is Shell Programming using Various Commands topic in division Essential Shell Programming of Unix |
|
Answer» Correct choice is (d) mailx |
|
| 55. |
We can use the here document with interactive programs also.(a) True(b) FalseThe question was posed to me during an interview.Enquiry is from Shell Programming using Various Commands in division Essential Shell Programming of Unix |
|
Answer» The CORRECT choice is (a) True |
|
| 56. |
____ command is the appropriate way to interrupt a program.(a) kill(b) SIGKILL(c) INT(d) trapThe question was posed to me in homework.Question is from Shell Programming using Various Commands in portion Essential Shell Programming of Unix |
|
Answer» Right ANSWER is (d) TRAP |
|
| 57. |
Any command using standard input can take the input from here document.(a) True(b) FalseI had been asked this question in an interview for internship.My question comes from Shell Programming using Various Commands in section Essential Shell Programming of Unix |
|
Answer» Correct option is (a) True |
|
| 58. |
The ____ allows us to read data from the same file containing the script.(a) >>(b) |
|
Answer» The CORRECT option is (b) << |
|
| 59. |
Which symbol is used with the set command for command substitution?(a) –(b) —(c) ??(d) _The question was posed to me in semester exam.This intriguing question originated from Shell Programming using Various Commands topic in section Essential Shell Programming of Unix |
|
Answer» Correct answer is (b) — |
|
| 60. |
Which one of the following is an internal command?(a) cut(b) expr(c) set(d) IsThis question was addressed to me in an interview.My doubt is from Shell Programming using Various Commands in portion Essential Shell Programming of Unix |
|
Answer» The correct CHOICE is (c) set |
|
| 61. |
____ statement is used for shifting arguments left.(a) set(b) shift(c) cut(d) pasteI had been asked this question during an interview.I'm obligated to ask this question of Shell Programming using Various Commands topic in portion Essential Shell Programming of Unix |
|
Answer» Correct answer is (B) shift |
|
| 62. |
Which command is used by the shell for manipulating positional parameters?(a) set(b) cut(c) case(d) pasteThis question was posed to me in an online interview.The question is from Shell Programming using Various Commands in portion Essential Shell Programming of Unix |
|
Answer» Right choice is (a) set |
|
| 63. |
Which command is used for changing filename extensions?(a) chown(b) rename(c) basename(d) rmThis question was posed to me in exam.I want to ask this question from Shell Programming using Various Commands topic in division Essential Shell Programming of Unix |
|
Answer» The correct option is (c) basename |
|
| 64. |
Which one of the following is used for looping with a list?(a) while(b) until(c) case(d) forThe question was asked in an internship interview.The doubt is from Shell Programming using Various Commands topic in division Essential Shell Programming of Unix |
|
Answer» RIGHT choice is (d) for Easy explanation: The SHELL’s for loop differs in structure as used in C. for loop doesn’t test a condition but it uses a LIST INSTEAD. The syntax for USING for loop is: |
|
| 65. |
Which of the following loop statements uses do and done keyword?(a) for(b) while(c) case(d) for and whileThe question was asked during an online interview.Enquiry is from Shell Programming using Various Commands topic in section Essential Shell Programming of Unix |
|
Answer» RIGHT answer is (d) for and while Explanation: Like while LOOP, for also uses the KEYWORDS do and DONE, but the additional parameters used in for are variables and list. |
|
| 66. |
Which of the following keywords are used in while loop?(a) do(b) done(c) then(d) do and doneThe question was asked in quiz.Question is from Shell Programming using Various Commands in portion Essential Shell Programming of Unix |
|
Answer» CORRECT ANSWER is (d) do and done Explanation: while LOOP repeatedly PERFORMS a set of instructions until the CONTROL command returns a true exit status. The general syntax for while loop is: |
|
| 67. |
until loop operates with a reverse logic as used in while loop.(a) True(b) FalseThis question was posed to me in my homework.Question is taken from Shell Programming using Various Commands in portion Essential Shell Programming of Unix |
|
Answer» Correct option is (a) True |
|
| 68. |
Which of the following commands let us perform a set of instructions repeatedly?(a) for(b) while(c) until(d) for, while, untilThe question was asked in an interview for internship.Asked question is from Shell Programming using Various Commands in portion Essential Shell Programming of Unix |
|
Answer» The correct choice is (d) for, while, until |
|
| 69. |
expr is a _____ command(a) internal(b) external(c) shell(d) derivedI had been asked this question in an international level competition.Query is from Case and Expr Command topic in division Essential Shell Programming of Unix |
|
Answer» CORRECT option is (b) EXTERNAL The EXPLANATION is: expr command is an external command. |
|
| 70. |
For locating the first position of a character in a string we can use expr command.(a) True(b) FalseThis question was posed to me during an online exam.Question is from Case and Expr Command topic in section Essential Shell Programming of Unix |
|
Answer» Right answer is (a) True |
|
| 71. |
Which of the following pattern is used for extracting a substring using expr?(a) /( )(b) \(. .\)(c) . .\)(d) \\(I have been asked this question in quiz.My question comes from Case and Expr Command topic in chapter Essential Shell Programming of Unix |
|
Answer» Right OPTION is (B) \(. .\) |
|
| 72. |
Which symbol is used for finding the length of the string?(a) .(b) *(c) .*(d) .*.I got this question in final exam.The query is from Case and Expr Command topic in section Essential Shell Programming of Unix |
|
Answer» The CORRECT option is (C) .* |
|
| 73. |
The string to be worked upon is placed on the left of the colon when using expr string handling function.(a) True(b) FalseI got this question in an international level competition.The above asked question is from Case and Expr Command topic in portion Essential Shell Programming of Unix |
|
Answer» Correct OPTION is (a) True |
|
| 74. |
Which of the following is performed by expr string handling’s function?(a) determine the length of string(b) extract a substring(c) locate the position of a character in a string(d) determine the length of string, extract and locate the position of the stringI have been asked this question in an interview for job.My doubt is from Case and Expr Command in section Essential Shell Programming of Unix |
|
Answer» Correct ANSWER is (d) DETERMINE the length of string, extract and locate the position of the string |
|
| 75. |
expr can perform ____ arithmetic operations.(a) 2(b) 4(c) 5(d) 3I had been asked this question in an internship interview.This interesting question is from Case and Expr Command topic in chapter Essential Shell Programming of Unix |
|
Answer» The CORRECT CHOICE is (c) 5 |
|
| 76. |
Which command is used for computation and string handling?(a) expr(b) case(c) if(d) readThe question was posed to me in final exam.Asked question is from Case and Expr Command topic in portion Essential Shell Programming of Unix |
|
Answer» Correct choice is (a) expr |
|
| 77. |
case can also be used for matching multiple patterns.(a) True(b) FalseI had been asked this question at a job interview.The question is from Case and Expr Command in portion Essential Shell Programming of Unix |
|
Answer» The correct CHOICE is (a) True |
|
| 78. |
case can also use wildcards to pattern matching.(a) True(b) FalseThis question was posed to me in examination.Enquiry is from Case and Expr Command in chapter Essential Shell Programming of Unix |
|
Answer» Right answer is (a) True |
|
| 79. |
The ___ option in case statement matches any option not matched by the previous options.(a) ^(b) $(c) *(d) //This question was addressed to me in exam.I'd like to ask this question from Case and Expr Command topic in portion Essential Shell Programming of Unix |
|
Answer» CORRECT answer is (C) * The EXPLANATION: The last option (*) or the default option is used for matching any option which is not matched by any of the previously specified OPTIONS. For example, |
|
| 80. |
case statement should have a corresponding closing esac.(a) True(b) FalseThis question was addressed to me in an international level competition.This is a very interesting question from Case and Expr Command in section Essential Shell Programming of Unix |
|
Answer» RIGHT choice is (a) True To explain I would SAY: Alike EVERY if statement is closed with a fi, CASE statement should also be closed with a CORRESPONDING esac. Without it, we’ll encounter an error. |
|
| 81. |
Every pattern in case statement in terminated with a _____(a) ;(b) :(c) ;;(d) //I have been asked this question by my college director while I was bunking the class.This interesting question is from Case and Expr Command topic in portion Essential Shell Programming of Unix |
|
Answer» The correct answer is (c) ;; |
|
| 82. |
____ statement matches an expression for more than one alternative.(a) for(b) while(c) elif(d) caseThe question was posed to me during an interview for a job.This question is from Case and Expr Command in portion Essential Shell Programming of Unix |
|
Answer» Correct option is (d) case |
|
| 83. |
To check if two files are linked to each other, we can use -ef option.(a) True(b) FalseThis question was posed to me in semester exam.This is a very interesting question from Using test and [ ] to Evaluate Expressions in section Essential Shell Programming of Unix |
|
Answer» Correct choice is (a) True |
|
| 84. |
____ option is used for checking whether a particular file is older than a specified file.(a) -ef(b) -old(c) -nt(d) -otThe question was asked in an interview for job.My question comes from Using test and [ ] to Evaluate Expressions in portion Essential Shell Programming of Unix |
|
Answer» Right option is (d) -ot |
|
| 85. |
-d option is used for checking if the file exists and is a directory.(a) True(b) FalseThis question was addressed to me in exam.I want to ask this question from Using test and [ ] to Evaluate Expressions topic in section Essential Shell Programming of Unix |
|
Answer» The CORRECT choice is (a) True |
|
| 86. |
To check if the file exists and is executable we have to use ___ option with test.(a) -e(b) -f(c) -x(d) -wThis question was posed to me during an interview.The question is from Using test and [ ] to Evaluate Expressions in section Essential Shell Programming of Unix |
|
Answer» The correct answer is (c) -x |
|
| 87. |
Which of the following option is used for checking if the file is writable or not?(a) -e(b) -f(c) -n(d) -wI got this question in unit test.I'd like to ask this question from Using test and [ ] to Evaluate Expressions in portion Essential Shell Programming of Unix |
|
Answer» The correct OPTION is (d) -W |
|
| 88. |
Which of the following option is used for checking if the file is readable or not?(a) -r(b) -f(c) -n(d) -zThis question was posed to me during an interview.This interesting question is from Using test and [ ] to Evaluate Expressions in portion Essential Shell Programming of Unix |
|
Answer» The correct choice is (a) -R |
|
| 89. |
Which option is used for checking if the file exists or not?(a) -e(b) -a(c) -n(d) -fThe question was posed to me in an interview for job.The question is from Using test and [ ] to Evaluate Expressions topic in portion Essential Shell Programming of Unix |
|
Answer» Right option is (a) -e |
|
| 90. |
We can use a test to test various file attributes.(a) True(b) FalseThe question was posed to me by my college professor while I was bunking the class.My question is from Using test and [ ] to Evaluate Expressions topic in chapter Essential Shell Programming of Unix |
|
Answer» Correct answer is (a) True |
|
| 91. |
Which one of the following option is used for checking that the string is NULL string?(a) -a(b) -o(c) -z(d) -nI got this question in unit test.Origin of the question is Using test and [ ] to Evaluate Expressions in division Essential Shell Programming of Unix |
|
Answer» The correct choice is (c) -z |
|
| 92. |
Which one of the following option is used for AND operation in test command?(a) -o(b) -a(c) -e(d) -anI got this question by my college director while I was bunking the class.This is a very interesting question from Using test and [ ] to Evaluate Expressions in division Essential Shell Programming of Unix |
|
Answer» The correct ANSWER is (b) -a |
|
| 93. |
Which one of the following option is used for checking that the string is not null?(a) -a(b) -o(c) -z(d) -nI have been asked this question in quiz.Question is from Using test and [ ] to Evaluate Expressions topic in chapter Essential Shell Programming of Unix |
|
Answer» The correct choice is (d) -n |
|
| 94. |
Which one of the following option is used for OR operation in test command?(a) -o(b) -a(c) -e(d) -anThis question was addressed to me in my homework.I'm obligated to ask this question of Using test and [ ] to Evaluate Expressions topic in chapter Essential Shell Programming of Unix |
|
Answer» Correct choice is (a) -o |
|
| 95. |
It is essential to use whitespaces when we use [].(a) True(b) FalseI had been asked this question in my homework.My query is from Using test and [ ] to Evaluate Expressions in portion Essential Shell Programming of Unix |
|
Answer» Correct choice is (a) True |
|
| 96. |
test and [ ] can be used for string comparison.(a) True(b) FalseI got this question in a national level competition.The query is from Using test and [ ] to Evaluate Expressions topic in chapter Essential Shell Programming of Unix |
|
Answer» Right option is (a) True |
|
| 97. |
Which of the following operator is used as a shorthand for test?(a) % %(b) [ ](c) & &(d) ( )The question was asked in semester exam.My doubt is from Using test and [ ] to Evaluate Expressions topic in division Essential Shell Programming of Unix |
|
Answer» Right choice is (b) [ ] |
|
| 98. |
We can use comparison operators without a ‘-‘.(a) True(b) FalseI have been asked this question during an interview.I want to ask this question from Using test and [ ] to Evaluate Expressions in chapter Essential Shell Programming of Unix |
|
Answer» Correct CHOICE is (b) False |
|
| 99. |
___ implies greater than and ____ implies less than.(a) gt, le(b) gt, lt(c) ge,le(d) ge,ltI have been asked this question during a job interview.Query is from Using test and [ ] to Evaluate Expressions in portion Essential Shell Programming of Unix |
|
Answer» Correct choice is (B) gt, lt |
|
| 100. |
Which of the following operators is used with test for comparison of numeric values?(a) -eq(b) -ne(c) -gg(d) –eq and -neThis question was addressed to me during an interview.My question comes from Using test and [ ] to Evaluate Expressions in division Essential Shell Programming of Unix |
|
Answer» The CORRECT choice is (d) –eq and -ne |
|