4 ms·
Run System Commands in Ruby – When to use which methods to run shell commands
- Joker_vD 2y agoI can't help but notice that all of those methods take a single command line string as a parameter. That's arguably fine on Windows, but not on Linux. So: how is that string broken down into the array of strings for the ultimate execve() call, in Ruby? Does Ruby parse it on its own (using some dialect of shell for quoting), or does it invoke the shell to do the heavy lifting, or?..
- masa331 2y agoThere is also a variant of 'system' which takes multiple agruments. It invokes the program in the first argument and passes the other arguments directly without going through shell so no globs etc. can take place. But this is not mentioned in the article but it is in Ruby docs
- Alifatisk 2y agoThe text blends in so well with the background, it is barely readable for me.
- BenjiWiebe 2y agoBlack text on white background for me. Do you have an add-on or something changing the site?
- Alifatisk 2y agoYeah you're right, it's my FF acting weird.
- oneneptune 2y agoCheck your browser extensions and add-ons. The title and body text have a 15.52:1 contrast ratio with the background, which is acceptable by all accessibility standards. The subtitle and background have a 5.32:1 contrast ratio with the background. This would be considered acceptable by most accessibility standards, though I would like it around 9:1.
- aquasync 2y agoWhile the article says that backticks don't provide access to the exit status, you can retrieve it with $?.exitstatus.
- deleted 2y ago[deleted]
- rererereferred 2y agoLately I've been using Bun shell for writing scripts, it's a nice alternative for those who prefer JavaScript syntax over Ruby: https://bun.sh/docs/runtime/shell https://bun.sh/docs/runtime/shell