Last active
February 18, 2025 00:22
-
-
Save HCLarsen/912d86d311f280bb58513d2446f2a1d8 to your computer and use it in GitHub Desktop.
A simple grep tool written in Crystal to display use of a RegExp and use of Command Line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abort "Need a regex pattern" unless ARGV.size > 0 | |
regex = ARGV.shift | |
STDIN.each_line do |i| | |
puts i if i =~ %r(#{regex}) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment