News for hackers. Stuff that matters.
Re:I got tired of PHP and Perl, so I tried bash by e12e on Saturday April 13, 2019 @09:37AM (#19652935)
Fwiw ruby borrows heavily from perl, and can be coaxed into serving as a driver for other commands. See eg:

http://ibmsystemsmag.com/aix/tipstechniques/systemsmanagemen...

https://redpanthers.co/different-ways-to-run-shell-commands-...

Perl/awk like one-liner/filters in ruby:

http://reference.jumpingmonkey.org/programming_languages/rub...

https://nithinbekal.com/posts/ruby-sed-awk/

Of note is that ruby allows "backtick execution":

filename = 'some_file.txt' wordcount = `wc --words #{filename}`

I find that much of the strength of bash/shell comes from the surrounding utilities though. So simply jumping to ruby won't magically let your "shell script" work on both windows and Linux, just because you have ruby installed;there likely not be a similar set of building blocks like "wc" etc. You could of course replicate most via the ruby std lib - and it's arguably easier to write test driven ruby than bash.

There are no comments on this comment yet.