Shell Scripting/Shell Scripting Mcq Question Set 1 Sample Test,Sample questions

Question:
 Given x=10 then, The given statement is ____

1.True

2. False

3.all of the above

4.None of the mentioned

Posted Date:-2022-01-27 12:19:21


Question:
 In UNIX there are ___ major types of shells.

1.2

2.3

3.4

4.many

Posted Date:-2022-01-27 12:24:36


Question:
 On a UNIX system, there can be ____ shells running simultaneously.

1. 1

2.2

3.many

4. 4

Posted Date:-2022-01-27 12:23:30


Question:
 Shell scripts need to be saved with an extension .sh .

1.True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-01-27 12:00:47


Question:
 The first argument is read by the shell into the parameter ___

1.1$

2.$3

3.$$

4.$1

Posted Date:-2022-01-27 12:04:36


Question:
 The prompt issued by the shell is called ______

1.prompt

2.command translator

3. command prompt

4.command executor

Posted Date:-2022-01-27 12:24:13


Question:
 The ____ allows us to read data from the same file containing the script.

1.>>

2. <<

3.!!

4.—

Posted Date:-2022-01-27 12:16:21


Question:
 We can use the here document with interactive programs also.

1.True

2. False

3.all of the above

4.None of the mentioned

Posted Date:-2022-01-27 12:17:20


Question:
 What is the default symbol for command prompt in C shell?

1. $

2.%

3. #

4.@a = split(/s/, $str).

Posted Date:-2022-01-27 12:25:24


Question:
 Where is the exit status of a command stored?

1.$0

2. $>

3.$1

4. $?

Posted Date:-2022-01-27 12:20:09


Question:
 Which command is used for changing filename extensions?

1.chown

2.rename

3.basename

4.rm

Posted Date:-2022-01-27 12:14:28


Question:
 Which of the following is false?

1.here document provides standard input to any script non interactively

2.read command is used for making scripts interactive

3.$* stores the number of arguments specified

4.&& and || are logical operators

Posted Date:-2022-01-27 12:20:39


Question:
 Which of the following loop statements uses do and done keyword?

1. for

2.while

3.case

4.for and while

Posted Date:-2022-01-27 12:14:04


Question:
A shell script stopped running when we change its name. Why?

1. location of the file changed

2. we can’t change the name of the script

3. $0 was used in the script

4. many possible reasons

Posted Date:-2022-01-27 12:19:45


Question:
A single read statement can be used with one or more variables.

1. True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-01-27 12:03:48


Question:
Any command using standard input can take the input from here document.

1.True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-01-27 12:16:39


Question:
Every time shift command is used, the leftmost variable is lost.

1.True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-01-27 12:22:02


Question:
In Shell’s interpretive cycle, the shell first scans for ____ in the entered command.

1.characters

2. priority

3.meta-characters

4.wildcards

Posted Date:-2022-01-27 12:27:04


Question:
read command is shell’s internal tool.

1.True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-01-27 12:03:27


Question:
Shell provides us with an interface to the operating system.

1.True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-01-27 12:23:08


Question:
Shell scripts are executed in a separate child shell process.

1. True

2. False

3.all of the above

4.None of the mentioned

Posted Date:-2022-01-27 12:01:06


Question:
Suppose x =10, then what will be the value of x$x$?

1.undefined

2.erroneous

3.100

4.x10$

Posted Date:-2022-01-27 12:18:49


Question:
test statement cannot ______

1.compare two numbers

2.compare two strings

3.compare two files

4.check a file’s attributes

Posted Date:-2022-01-27 12:21:22


Question:
The complete set of positional parameters is stored in ______ as a single string.

1. $n

2.$#

3. $*

4.$$

Posted Date:-2022-01-27 12:05:00


Question:
The first line in any shell script begins with a _____

1. &

2. !

3.$

4. #

Posted Date:-2022-01-27 12:01:38


Question:
The shell waits for the command to complete and normally can’t do any work while the command is executing.

1.True

2. False

3.all of the above

4.None of the mentioned

Posted Date:-2022-01-27 12:27:46


Question:
There can be multiple kernels on a single UNIX system.

1.True

2.FALSE

3.all of the above

4.None of the mentioned

Posted Date:-2022-01-27 12:23:50


Question:
To run the script, we should make it executable first by using _____

1.chmod +x

2.chmod +r

3.chmod +w

4.chmod +rwx

Posted Date:-2022-01-27 12:02:21


Question:
To spawn a child of our own choice for running the script, we can use ___ command.

1.ps

2.pr

3.sh

4.$$

Posted Date:-2022-01-27 12:02:45


Question:
until loop operates with a reverse logic as used in while loop.

1.True

2.False

3.all of the above

4.None of the mentioned

Posted Date:-2022-01-27 12:13:12


Question:
What are positional parameters?

1. special variables for assigning arguments from the command line

2. pattern matching parameters

3.special variables for reading user input

4.special variables and patterns

Posted Date:-2022-01-27 12:04:10


Question:
What is a shell script?

1.group of commands

2.a file containing special symbols

3. a file containing a series of commands

4.group of functions

Posted Date:-2022-01-27 12:00:23


Question:
What is the default symbol for command prompt in Bourne shell?

1. $

2.%

3.#

4. @

Posted Date:-2022-01-27 12:25:03


Question:
Which command does not terminates unless we log out of the system?

1.history

2.shell

3.echo

4.login

Posted Date:-2022-01-27 12:26:32


Question:
Which command is used by the shell for manipulating positional parameters?

1.set

2. cut

3.case

4. paste

Posted Date:-2022-01-27 12:14:51


Question:
Which command is used for making the scripts interactive?

1.ip

2.input

3.read

4.Write (append)

Posted Date:-2022-01-27 12:03:09


Question:
Which of the following command doesn’t accept a filename as an argument?

1. cut

2.ls

3.paste

4.mailx

Posted Date:-2022-01-27 12:17:02


Question:
Which of the following commands let us perform a set of instructions repeatedly?

1.for

2.while

3.until

4. for, while, until

Posted Date:-2022-01-27 12:12:27


Question:
Which of the following expression is a correct wildcard pattern if we want an expression in which the last character is not numeric?

1. *[!0]

2. *[0-9]

3.[0-9]

4.*[!0-9]

Posted Date:-2022-01-27 12:27:26


Question:
Which of the following is used for storing the number of positional parameters?

1.$n

2.$#

3. $*

4.$2

Posted Date:-2022-01-27 12:05:23


Question:
Which of the following keywords are used in while loop?

1. do

2.done

3.then

4.do and done

Posted Date:-2022-01-27 12:12:52


Question:
Which of the following option is used with a set for debugging shell scripts?

1.-a

2.-x

3.-d

4.-e

Posted Date:-2022-01-27 12:18:26


Question:
Which one of the following command will display the name of the shell we are working on?

1.echo shell

2.echo $

3. echo $SHELL

4.echo $$

Posted Date:-2022-01-27 12:25:49


Question:
Which one of the following is an internal command?

1.cut

2.expr

3. set

4.isMaster

Posted Date:-2022-01-27 12:15:35


Question:
Which one of the following is used for looping with a list?

1.while

2.until

3.case

4.for

Posted Date:-2022-01-27 12:13:38


Question:
Which shell is the most common and best to use?

1.Korn shell

2.POSIX shell

3. C shell

4. Bash shell

Posted Date:-2022-01-27 12:26:11


Question:
Which symbol is used with the set command for command substitution?

1. –

2. —

3. ??

4. _

Posted Date:-2022-01-27 12:15:59


Question:
___ option is used with a test for checking if the file exists and has the size greater than zero.

1. -f

2. -r

3.-e

4. -s

Posted Date:-2022-01-27 12:21:44


Question:
____ command is the appropriate way to interrupt a program.

1. kill

2.SIGKILL

3. INT

4. trap

Posted Date:-2022-01-27 12:17:43


Question:
____ statement is used for shifting arguments left.

1. set

2. shift

3.cut

4. paste

Posted Date:-2022-01-27 12:15:12


More MCQS

  1. Shell Scripting Mcq Question Set 1
  2. Shell Scripting Mcq Question Set 2
  3. Shell Scripting Mcq Question Set 3
  4. Shell Scripting Mcq Question Set 4
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!