Hacker News new | ask | show | jobs
by kondro 3892 days ago
True, but if you write Ruby all day and are most familiar with it, a script like this takes a matter of minutes to write compared to trawling the man pages of grep/awk/sed to implement the same thing you're only going to throw away after execution anyway.
2 comments

After you are familiar with the shell tools, it takes seconds to write something like this, not minutes.
Sure if you control the environment and can install Ruby. grep/sed/awk are always installed.
Presumably, if you write ruby all day, there is a good chance that the environments you encounter have ruby installed, as well (and they might be even be Windows environments, in which case grep/sed/awk are not "always installed.")
Portability becomes a problem though. GNU vs BSD sed/grep :(
They do have a shared subset of features defined by POSIX. It's limiting and takes discipline, but it's not really impractical.