#!/usr/bin/env fctool # a dumb grep clone abomination %if {output_file == ""} output_file = stdout %endif [{output_file}] %func grep %if {match(".*" ++ pattern ++ ".*", line)} {line} %endif %endfunc %if {input_file == ""} %foriter {grep()}\ %endfor %else %for line : {$[input_file]} {grep()}\ %endfor %endif