Part III: Write down the output of the last command in each question and describ
ID: 3756830 • Letter: P
Question
Part III: Write down the output of the last command in each question and describe the function of it. Note: please do not simply say awk executes the commands from a file. Question 1) to 4) are processing the same text file "float". "float" has a content shown as in the table below. To try those commands in the questions, you can create your own "float" file in your Ubuntu system. Wish I was floating in blue across the sky, my imagination is strong, And I often visit the days When everything seemed so clear. Now I wonder what I'm doing here at all. Hint: you may need to create "hl.awk" and "h2.awk" in your own computer by yourself.Explanation / Answer
2)
Output:
Unix Terminal> awk '{print $1, $NF}' float
Wish strong,
And days
When clear
Now all...
Unix Terminal>
Explanation:
1) The awk command prints first and last column in the file float
2) $1 represents first column and $NF represents last column. For example, the line "And I often visit the days" has "And" as the first column and "days" as the last column which gets printed by the awk command