Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Linux OS Interviews:Awk ProgrammingBash Arithmetic ExpressionsDevice DriversGCC CompilerLinux AdministratorLinux CommandsLinux DebuggingLinux EnvironmentLinux GeneralLinux IPCLinux MakefileLinux OSLinux OS EditorsLinux OS ManagementLinux OS ShellLinux Proc FilesystemLinux Search PatternLinux Shared & Static LibrariesLinux Socket ProgrammingLinux Startup and ShutdownLinux SysfsLinux SystemsLinux ThreadsLinux UbuntuSignal HandlingSystem Calls
Copyright © 2018. All Rights Reserved
Awk Programming Interview Question:
The command "awk '{if ("9″>"10″) print "google" else print "linux"}'"
a) will print "google"
b) will print "linux"
c) will generate syntax error
d) none of the mentioned
Submitted by: Murtazac) will generate syntax error
Explanation:
Semicolon is required just before the else statement to parse the statement.
Output:
root@ubuntu:/home/google# awk '{if ("9″>"10″) print "google" else print "linux"}'
awk: {if ("9″>"10″) print "google" else print "linux"}
awk: ^ syntax error
root@ubuntu:/home/google#
Submitted by: Murtaza
Explanation:
Semicolon is required just before the else statement to parse the statement.
Output:
root@ubuntu:/home/google# awk '{if ("9″>"10″) print "google" else print "linux"}'
awk: {if ("9″>"10″) print "google" else print "linux"}
awk: ^ syntax error
root@ubuntu:/home/google#
Submitted by: Murtaza
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.