Question 51Asked in UGC NET Computer Science, June 2014 (Paper II & III, Selected Questions)

Match the following with reference to Unix shell scripts : List-I

Match the following with reference to Unix shell scripts : List-I (A) $? (B) $# (C) $0 (D) $* List-II (i) File name of the current script (ii) List of arguments (iii) The number of arguments (iv) Exit status of last command Codes : A B C D
  1. Aiii ii i iv
  2. Bii iii i iv
  3. Civ iii i ii
  4. Di iii i iv
Show answerHide answer

Correct answer: (C) iv iii i ii

Explanation

$? : exit status of the last command executed. $# : number of arguments supplied to a script. $0 : file name of the current script. $* : all the arguments (list of arguments). So A-iv, B-iii, C-i, D-ii, i.e. option (c).

From UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions)

This is question 51 of UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.