Awk Programming

  Home  Operating System Linux  Awk Programming


“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”



40 Awk Programming Questions And Answers

7⟩ What is the output of this program? #! /usr/bin/awk -f BEGIN { print "20"<"9" ? "true""false" } a) true b) false c) syntax error d) none of the mentioned

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#

 157 views

15⟩ Which one of the following is not true? a) in typical awk program, all input is read either from standard input or specified files b) awk language divides its input into records and fields c) awk reads an input record and the record is automatically seperated by the interpreter into pieces called "fields" d) the number of fields need to be a constant

d) the number of fields need to be a constant

Explanation:

The number of fields does not need to be a constant.

 172 views