AWK Programming – Question & Answer-1

AWK Programming - Question & Answer-1

AWK Programming – Question & Answer-1

در این مقاله به بررسی سوالات و جواب های مربوط به AWK Programming

  می پردازیم .

۱- An awk program can be run by

              a) including the program in the command that runs awk

              b) putting it into a file and run with a command

              c) running an executable awk script

              d) all of the mentioned


 ۲- Which one of the following is not true?

            a) nawk is the new version of awk

            b) gawk is the GNU version of awk

            c) linux users have the gawk

            d) nawk does not provide the additional capabilities in comparison of awk


۳- 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

 


۴- What is the meaning of $ sign in awk programming?

           a) the word following is the name of variable

           b) we are refering to a field or column in the current line

           c) $ sign is used for comment

           d) none of the mentioned


۵-  In awk program, the statement print with no items

           a) is equivalent to print $0

           b) prints the entire current record

           c) is equivalent to print $0 & prints the entire current record

          d) none of the mentioned


۶- The print and printf statements can be told to send their output to other place except standard output, is called

         a) redirection

         b) redistribution

         c) reinsertion

         d) none of the mentioned


۷- The command awk {print $1} tnsnames.txt will

        a) print the first line of file tnsnames.txt

        b) print the first field of every line in tnsnames.txt

        c) generate syntax error

       d) none of the mentioned

 


۸- What is the output of the command awk BEGIN {printf %c\n,۶۵}

           a) A

          b) 65

          c) syntax error

         d) none of the mentioned


۹- Which one of the following statement is not true about the format-control letters for printf statement in awk program?

           a) c prints a number as an ASCII character

           b) d prints a decimal integer

           c) h prints an unsigned hexadecimal integer

          d) o prints an unsigned octal integer


۱۰- Which command on the command line provides the same output as this executable awk script?

     #! /usr/bin/awk -f

    BEGIN {

        print “mislinux”

    }

a) awk BEGIN {print “mislinux}

b) awk print “mislinux”‘

c) awk print {mislinux}

d) none of the mentioned

0 پاسخ

دیدگاه خود را ثبت کنید

تمایل دارید در گفتگوها شرکت کنید؟
در گفتگو ها شرکت کنید.

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *