1⟩ What is expression in awk programming? a) expression evaluates a value to print, test or pass to a function b) expression assigns a new value to a variable or field c) both (a) and (b) d) none of the mentioned
c) both (a) and (b)
“Awk Programming frequently Asked Questions in various Awk Programming job Interviews by interviewer. The set of questions here ensures that you offer a perfect answer posed to you. So get preparation for your new job hunting”
c) both (a) and (b)
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)
a) redirection
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#