【发布时间】:2011-03-09 16:09:51
【问题描述】:
这是来自课程的材料。根据我的研究,代码总是以 shebang 开头
#! /bin/sh
我还想解决这个问题,我可能需要使用
的组合wc, tail, grep, head
但是我很难把它放在一起。非常感谢您的帮助。
Write a shell command that processes a file
that is 200 lines long or more. It outputs the number of those lines within lines 100 through
199 *inclusive* that contain the character string “hello”.
Write a shell command that outputs the number of lines in the lines range
100..199 that contain "hello, " but is NOT followed by "world".
【问题讨论】:
-
行数是从0还是1开始?
-
在第一个任务中你的意思是你只需要打印相关行的行号?