MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

UNIX

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The complete set of positional parameters is stored in ____ as a single string.
A
$n
B
$#
C
$*
D
$$
Explanation: 

Detailed explanation-1: -12. The complete set of positional parameters is stored in as a single string. Explanation: There are some special parameters used by the shell. One of which is $*, which stores the complete set of positional parameters as a single string.

Detailed explanation-2: -The variable # holds the number of positional parameters (as a character string).

Detailed explanation-3: -‘$#‘ refer to ‘The value of the total number of command line arguments passed. ‘ Thus, you can use $# to check the number of arguments/parameters passed like you did and handle any unexpected situations. etc.

Detailed explanation-4: -A positional parameter is a parameter denoted by one or more digits, other than the single digit 0 . Positional parameters are assigned from the shell’s arguments when it is invoked, and may be reassigned using the set builtin command.

There is 1 question to complete.