Created
November 22, 2010 03:53
-
-
Save capotej/709493 to your computer and use it in GitHub Desktop.
makes string safe to grep for ps auxwww
This file contains 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
# turns hey => "[h]ey" | |
def grep_safe(path) | |
"[#{path.chars.first}]#{path.chars.to_a.slice(1, path.chars.count).join}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment