作者p31415926535 (π)
看板EE_DSnP
标题[问题] HW1.1
时间Sat Sep 24 20:59:16 2011
请问一下:
作业1.1 第二题的(b)分成两个部份
可是如果对去掉“ Darr (nothing)”的档案做第二部份的动作
即“extract the lines from (1)”
则第一行出现的行号是
9117: Output Transition Time: -115.761
而如果对没有去掉“ Darr (nothing)”的档案做第二部份的动作
第一行出现的行号才是正确的
10002: Output Transition Time: -115.761
问过之前修资结的同学,
他们那时候的作业要求是从
Use the “grep” command to extract the lines from “hw1.1.p2.log” with the
pattern “Output Transition Time” and use the command “sort” to sort them in
the ascending order of the transition time.
而不是从去掉“ Darr (nothing)”的档案做排序的动作
可是结果今年的参考结果跟去年一样……
所以请问老师,我们应该是跟去年一样用原始的“hw1.1.p2.log”去跑
出来第一行10002: Output Transition Time: -115.761
还是用去掉“ Darr (nothing)”的档案去跑
出来第一行9117: Output Transition Time: -115.761?
谢谢!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.25.107
1F:→ djshen:会出现9117表示你是去掉Darr (nothing) 才加行号的吧 09/24 21:28
2F:→ p31415926535:所以想请问作业要求是不是要去掉那几行再加行号? 09/24 21:48
3F:推 victoret:Prefix each line of output with the original line 09/24 22:18
4F:→ victoret:number in “hw1.1.p2.log”. 09/24 22:18
5F:→ victoret:应该是先加行号吧 09/24 22:19
6F:推 ric2k1:题目有说: Prefix each line of output with the original 09/24 22:20
7F:→ ric2k1:line number in “hw1.1.p2.log”. 所以是 10002, 不是9117 09/24 22:21
8F:→ concise:Prefix each line of output with the original line 09/24 22:24
9F:→ concise:number in “hw1.1.p2.log”. 09/24 22:25
10F:推 rf0914:所以MustExist里的p2.log是要存a小题去掉Darr行的结果吗? 09/24 22:33
11F:推 ric2k1:p2.log 是原来的档案,p2b.log 是做完 2(b) 最後的结果 09/24 22:36
12F:→ ric2k1:p2a.cmd, p2b.cmd 分别是 2(a) 与 2(b) 所用到的 commands. 09/24 22:37
13F:推 ric2k1:刚刚才发现原来三楼已经 PO 过了... 眼残 XD 09/24 22:38
14F:推 rf0914:所以a小题的指令只要能够把结果输出到萤幕上就好罗?? 09/24 22:43
15F:推 victoret:个人比较想知道行号後面的冒号是怎麽出现的...弄不出来 09/24 22:57
16F:→ victoret:楼楼上问的在 #1AljW0US 有提到 09/24 23:10
17F:推 ric2k1:冒号可以 man 一下 grep 09/24 23:16
18F:→ rf0914:噢不对我的意思是关於a小题,我只需要写个指令把去掉Darr行 09/24 23:16
19F:→ rf0914:的结果输出在萤幕上,而不是直接更改原始档案,这样对吗? 09/24 23:17
20F:→ victoret:我自己是这样做啦XD 09/24 23:21
21F:推 ric2k1:对! 是输出在萤幕,不是直接改 p2.log. 然後用 | 或是 > 把 09/24 23:25
22F:→ ric2k1:结果存起来. BTW, 你是指 2(b) 的 (1) 吧!? sorry for the 09/24 23:26
23F:→ ric2k1:confusion! 09/24 23:26
24F:推 rf0914:了解~ 多谢教授~ 09/24 23:27
25F:推 victoret:喔喔原来是用 grep 不是用 nl!感谢教授! 09/24 23:37
26F:→ p31415926535:原来是是输出在萤幕,不是直接改 p2.log!谢谢教授 09/25 09:31