Live data from Hacker News

Ruby: A great language for shell scripts

lucasoshiro.github.io

331–340 of 368 posts

Re: Ruby: A great language for shell scripts

#332
post #153

Earlier quoted context omitted.

Interesting! I still find Python too verbose to stand in for shell scripts when Perl is available, with what I think is a decent chunk of experience.

Ha - I actually haven't changed my opinion about verbosity, Python is still more verbose and I will choose Perl for throwaway scripts even today; I just have a greater appreciation of readability of Python code compared to the free-for-all style-fest of Perl code (admittedly written by a bunch of devs with little code style enforcement). Perl is great for smaller scripts but I'm talking about many thousands lines of…

Thousands of lines := time to use a real (compiled) language

Re: Ruby: A great language for shell scripts

#333
post #23
post #20

No it’s not a great language. Too many ways to do the same thing. Not packaged by default on most Linux. Monkey patching makes things even harder to debug.

yeah. The not packaged by default is the killer issue.

You are one command away from having ruby in your system, is the threshold really that high?

Re: Ruby: A great language for shell scripts

#334

Java for the win. Have used java for any kind of programming or running shell commands or literally anything since last 5 years professionally and personally. Language is just a tool, anything and everything works if you love it enough

Sounds like you’d be interested JRuby :)

Re: Ruby: A great language for shell scripts

#335

Overall a nice lite write up! Bash is great, but it occasionally becomes untenable, usually around the time where HTTP and whatnot becomes involved. Same goes for shell exec exit codes, you can use an API like popen3 for this: https://ruby-doc.org/stdlib-2.4.1/libdoc/open3/rdoc/Open3.ht... You mention using threads and regex match global variables in the same write up. Please use the regex match method response inste…

Thanks for the comment! Even though I wrote this about Ruby, I must admit that I am not a specialist.

No problem at all, and you don’t need to be a specialist to be excited and write something up :) I hope this didn’t come across as judgy, I’ve just lived through many a Ruby bug heh

Re: Ruby: A great language for shell scripts

#336

Earlier quoted context omitted.

[flagged]

Every compiled language can do it until you run into issues with glibc vs musl or openssl version or network stack defaults and remember you weren't as static as you thought.

[dead]

Re: Ruby: A great language for shell scripts

#337
post #207

Earlier quoted context omitted.

Not once have I worked anywhere where the people writing shell scripts didn't also control all of the boxen those scripts ran on.

I'm glad you never worked at a bank or an insurance company!

[dead]

Re: Ruby: A great language for shell scripts

#340
post #292

Earlier quoted context omitted.

One advantage of a scripting language for scripts is that you can read it and see what it does one month later...

Sure, especially every bash script that goes over 200-250 lines is super readable. /s Or when you have to start using all the combinations of characters to achieve f.ex. proper iteration through an array without word splitting. Etc. to infinity. I've danced this dance hundreds of times and got sick of it. Gradually moving away from scripts and to Golang programs and so far it has been an improvement in almost every w…

still more readable than disassembler output :)

sure if it's your "script" and you know exactly the code corresponding to it it might be ok, but that's a lot of overhead for a disposable script.

Post reply on HN