题目
题目
单项选择题

Shell command (1 mark)How many lines will be output by the following shell command? cat data.csv | awk -F’,’ ’rand()<9/10 {print $9}’[Fill in the blank]

选项
A.A. approximately 9% of the lines in the original file
B.B. approximately 90% of the lines in the original file
C.C. impossible to tell
D.D. exactly 10
题目图片
查看解析

查看解析

标准答案
Please login to view
思路分析
The question asks how many lines will be output by the pipeline: cat data.csv | awk -F’,’ ’rand()<9/10 {print $9}’. First, consider what the awk command is doing: -F’,’ sets the input field separator to a comma, so $9 refers to the 9th field in each line. The condition rand()<9/10 is a per-line test that uses the built-in rand() function, which generates a random......Login to view full explanation

登录即可查看完整答案

我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!