⟩ Fork returns _____ to parent process on success a) 0 b) child process id c) parent process id d) none
b) child process id
b) child process id
What is the output of this program? #!/bin/bash san_var="google" echo "$san_var" echo '$san_var' echo '"$san_var"' echo "'$san_var'" echo $san_var exit 0 a) google $san_var "$san_var" 'google' $san_var b) google google "google" 'google' google c) program will generate an error message d) program will print nothing
What is the output of this program? #!/bin/bash var1=10 $var1=20 echo $var1 exit 0 a) program will print 10 b) program will generate a warning message c) program will print 20 d) both (a) and (b)
What is the output of this program? #!/bin/bash var[1]=san_1 var[2]=san_2 var[3]=san_3 echo ${var[*]} exit 0 a) san_1 b) san_2 c) san_3 d) san_1 san_2 san_3
To redefine a variable, it can be removed from the list of variables by using the command a) unset b) delete c) remove d) clear
How to feed standard output of one command to standard input of another in a single shell session? a) IO redirection can be used b) Named pipes can be used c) The pipe operator provided by the shell can be used d) It can not be done
cmd > abc 2>&1 will a) Write file2 to file1 b) Write standard output and standard error to abc c) Write standard error to abc d) Write standard output to abc & standard error to monitor
The following commands gives the output like this #cat file1 file2 #cat file1 No such file or directory hello If we execute the command "cat file1 file2 1>2 2>&1" the output would be a) cat file1 No such file or directory hello b) No output is displayed c) Cat 1>2 No such file or directory d) hello
cat < file1 >> file2 | file3 a) file1 content will be appended to file2 and finally stored in file3 b) file1 content will be appended to file2 and file3 will be ignored c) file2 and file3 will have same content d) syntax error
Which variable is used to display number of arguments specified in command line a) $0 b) $# c) $* d) $?
Syntax to suppress the display of command error to monitor? a) command > &2 b) command 2> &1 c) command 2> &2 d) command 2> /dev/null