41⟩ Which of the following file set in the current directory are identified by the regular expression a?b*? a) afcc, aabb b) aabb, axbc c) abbb, abxy d) abcd, axbb
b) aabb, axbc
“Linux OS Shell frequently Asked Questions by expert members with experience in Linux Shell. These questions and answers will help you strengthen your technical skills, prepare for the new job test and quickly revise the concepts”
b) aabb, axbc
b) exit status of the last command executed
b) zero or more charecter
c) both (a) and (b)
Explanation:
'declare -F' provides just the name of the functions and 'declare -f' provides their definitions also.
c) both (a) and (b)
a) by using the parameter variables $1, $2, $3…….
d) nothing will print
Explanation:
Function definition was deleted before calling the function. command 'unset -f function_name' deletes the function definition.
Output:
root@ubuntu:/home/google# ./test.sh
./test.sh: 6: san_function: not found
root@ubuntu:/home/google#
d) none of the mentioned
Explanation:
Function must be defined prior to call. Hence only first string will print and program will generate an error also.
Output:
root@ubuntu:/home/globalguideline# ./test.sh
Just call the function
./test.sh: 3: san_function: not found
root@ubuntu:/home/globalguideline#
a) read
d) 2_san
Explanation:
The shell variable can contain only letters(a to z or A to Z), numbers(0 to 9), or a underscore character(_) and a variable can not start with a number.
a) string
a) hello
Explanation:
After the execution of the 'readonly' command, shell will not provide the permission to overwrite the value stored in variable 'san_var'.
Output:
root@ubuntu:/home/google# ./test.sh
./test.sh: line 4: san_var: readonly variable
hello
root@ubuntu:/home/google#
a) the value of "san_var" is 10
Output:
root@ubuntu:/home/google# ./test.sh
the value of "san_var" is 10
root@ubuntu:/home/google#