So all the test scores are checked if greater than 35, then it prints the whole line and string "Pass", else i.e even if any one of the test score doesn’t meet the condition, it prints the whole line and prints the string "Fail". Just like in the if-else statement, if the. For example, we can check the age of the person and act accordingly if over 60 or below 60. if - if else used to check the given situation or operations and run accordingly. if - if else is a very useful conditional statement used to create decision trees. The condition for Pass is all the test score mark should be greater than or equal to 35. Awk also has a conditional operator, the ternary operator ( : ) which works like the equivalent one in C. Awk provides different functionalities and structures like programming languages. If the condition returns true action1 will be performed, if the condition is false action 2 will be performed. In the awk If Else statement you can give the list of action to perform if the condition is false. In the above simple awk If statement, there is no set of actions in case if the condition is false. Some score for the student Dayan is missing Some score for the student RinRao is missing
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |