>>697
ありがとございます
リストとパターンマッチのコンビは強力ですね

お礼がてら GNU Smalltalk でも書いてみました
普通に手続き的に書くとこんな感じです(インデントの全角スペースは適宜置き換えてください)

#!/path/to/gst -f
argv := Smalltalk arguments.
file := argv first.
word := argv second.

stream := FileStream open: file mode: FileStream read.
[stream atEnd] whileFalse: [
  | line |
  line := stream nextLine.
  (line indexOfSubCollection: word) > 0 ifTrue: [line displayNl]].
stream close

少しだけ関数型的なものを意識するとこんな感じになりますか

#!/path/to/gst -f
argv := Smalltalk arguments.
file := argv first.
word := argv second.

lines := file asFile contents lines.
filtered := lines select: [:str | (str indexOfSubCollection: word) > 0].
joined := String join: filtered separatedBy: Character nl asString.

joined displayNl