Skip to content

Instantly share code, notes, and snippets.

@chad
Created October 8, 2013 15:00
Show Gist options
  • Save chad/6886103 to your computer and use it in GitHub Desktop.
Save chad/6886103 to your computer and use it in GitHub Desktop.

Revisions

  1. chad created this gist Oct 8, 2013.
    4 changes: 4 additions & 0 deletions ryan.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    require 'fileutils'
    Dir.mkdir("hello") unless Dir.exist?("hello")
    FileUtils.mkdir_p("/tmp/foo/bar/baz/this/is/easy/no")
    Dir["/etc/**/*"].each { |f| puts IO.readlines(f).grep(/chad/i) rescue nil}
    5 changes: 5 additions & 0 deletions ryan.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    if [ ! -d "hello" ] ; then
    mkdir "hello"
    fi
    mkdir -p /tmp/foo/bar/baz/this/is/easy/too
    find /etc/ -exec grep -i chad {} \; 2>/dev/null