d) 3
Output:
root@ubuntu:/home/google# chmod +x test.awk
root@ubuntu:/home/google# ./test.awk
3
root@ubuntu:/home/google#
a) google provides linux MCQs
Output:
root@ubuntu:/home/google# chmod +x test.awk
root@ubuntu:/home/google# ./test.awk
google provides linux MCQs
root@ubuntu:/home/google#
c) 11
Explanation:
The remainder of 10/3 is 1. remainder is added to 10.
Output:
root@ubuntu:/home/google# chmod +x test.awk
root@ubuntu:/home/google# ./test.awk
11
root@ubuntu:/home/google#
a) true
Output:
root@ubuntu:/home/google# chmod +x test.awk
root@ubuntu:/home/google# ./test.awk
true
root@ubuntu:/home/google#
c) the string x matches the regular expression denoted by y
a) true
Explanation:
The operands of relational operators are converted to, and compared as string if both are not numbers. Strings are compared by comparing the characters of each. Hence 20 is less then 9.
Output:
root@ubuntu:/home/google# chmod +x test.awk
root@ubuntu:/home/google# ./test.awk
true
root@ubuntu:/home/google#
a) double precision floating point
a) writing expressions next to one another, with no operator
a) awk 'BEGIN {print "google"}'
d) comparison expressions does not compare strings for relationship
a) A
Explanation:
The ASCII value of A is 65.
b) print the first field of every line in san.txt
c) "h" prints an unsigned hexadecimal integer
Explanation:
"x" prints and unsigned hexadecimal integer
d) the number of fields need to be a constant
Explanation:
The number of fields does not need to be a constant.
c) both (a) and (b)
d) all of the mentioned
Explanation:
The method used to run awk program depends on the program size and input files.
d) nawk does not provide the additional capabilities in comparison of awk
b) 0 2
Output:
root@ubuntu:/home/google# ./test.awk
0
2
root@ubuntu:/home/google#
a) google
Output:
root@ubuntu:/home/google# ./test.awk
google
root@ubuntu:/home/google#
a) "google" will print 2 times
Output:
root@ubuntu:/home/google# ./test.awk
google
google
root@ubuntu:/home/google#
a) google
Output:
root@ubuntu:/home/google# ./test.awk
google
root@ubuntu:/home/google#
b) program will print nothing
Explanation:
The built-in variable FILENAME is the name of file that awk is currently reading and in this program there is no file listed on the command line.
Output:
root@ubuntu:/home/google# ./test.awk
root@ubuntu:/home/google#