Tag: operating systems

Questions Related to operating systems

  1. test $a -eq $b

  2. test $a -equal $b

  3. test $a = $b

  4. sh -c test $a == $b


Correct Option: C
  1. test sleep 1

  2. sleep 1 && echo $0

  3. sleep 1 & echo $!

  4. sleep 1 & echo $$


Correct Option: C
  1. tree=maple; export tree; sh -c "echo $tree"

  2. tree=maple; export $tree; sh -c "echo $tree"

  3. $tree=maple; echo $tree

  4. export tree = maple; echo $tree


Correct Option: A
  1. "$@" takes the entire list and seperates it into special arguments whereas "$*" takes the entire list as one argument with spaces between them

  2. "$*" takes the entire list and seperates it into special arguments whereas "$@" takes the entire list as one argument with spaces between them

  3. Both statements will behave in the same way

  4. None of the above


Correct Option: A
  1. The getopts command ensures that a parameter is passed for -b option

  2. It signifies that u have to either specify -a option or you have to specify both -b and -c options

  3. The ":" has no effect in the command

  4. The getopts command ensures that a parameter is passed for -a option


Correct Option: D
  1. grep '\' filename

  2. grep \\ filename

  3. grep '\\' filename

  4. grep "\\" filename


Correct Option: A,B,D