Skip to content

Instantly share code, notes, and snippets.

@umhan35
Created March 30, 2013 04:13
Show Gist options
  • Save umhan35/5275316 to your computer and use it in GitHub Desktop.
Save umhan35/5275316 to your computer and use it in GitHub Desktop.
grep '{first arg}' . -R
#!/usr/bin/ruby
if ARGV.length != 1
print "[Exit] need 1 argument (now #{ARGV.length})\n"
exit
end
pattern = ARGV[0]
cmd = "grep '#{pattern}' . -R"
puts cmd
puts `#{cmd}`
@umhan35
Copy link
Author

umhan35 commented Jun 5, 2013

BASH version:
grep $1 . -R

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment