Tag: grep

  • Ruby: Enumerable grep, grep_v

    UPDATE: After I wrote this, I started finding myself doing a lot of caller.grep(/(project_directory|suspected_gem)/) to aid in debugging obscure interactions with internal gems and projects. In looking at a pull request and noticing some awkward “first” and “last” iteration detection which also required each_with_index, I started looking into what would be a cleaner way, and…

  • Emulating Grep in Powershell

    Emulating Grep in Powershell. The option presented is to perform a grep on several files. For a search in one file, with results going to output.txt select-string -pattern “{pattern}” -caseSensitive c:pathtofile.txt > output.txt One note: The lines wrapped at the width of the command window, even when redirected to a file.