cmdtest/t/bin/grep.rb
Johan Holmberg 67a662f1c6 use env.rb and grep.rb in test
to avoid depending on some env.exe and grep.exe
on Windows.
2016-11-17 10:30:29 +01:00

14 lines
148 B
Ruby
Executable File

#!/usr/bin/ruby
pattern = Regexp.new(ARGV[0])
n = 0
for line in STDIN
if line =~ pattern
puts line
n += 1
end
end
exit(n == 0 ? 1 : 0)